-
Notifications
You must be signed in to change notification settings - Fork 43
55 lines (50 loc) · 1.43 KB
/
Copy pathsync-gitcode-release.yml
File metadata and controls
55 lines (50 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Sync Release to GitCode
on:
workflow_dispatch:
inputs:
tag:
description: GitHub Release tag to synchronize
required: true
type: string
permissions:
contents: read
jobs:
resolve-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Resolve source Release tag
id: tag
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
INPUT_TAG: ${{ inputs.tag }}
run: |
if [[ "$EVENT_NAME" == "release" ]]; then
tag="$RELEASE_TAG"
else
tag="$INPUT_TAG"
fi
if [[ -z "$tag" ]]; then
echo "Release tag is required." >&2
exit 1
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
sync:
needs: resolve-tag
runs-on: windows-latest
concurrency:
group: gitcode-release-${{ needs.resolve-tag.outputs.tag }}
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Synchronize published GitHub Release
shell: pwsh
env:
SOURCE_TAG: ${{ needs.resolve-tag.outputs.tag }}
GH_TOKEN: ${{ github.token }}
GITCODE_ACCESS_TOKEN: ${{ secrets.GITCODE_ACCESS_TOKEN }}
run: .\Scripts\Sync-GitCodeRelease.ps1 -Tag $env:SOURCE_TAG -Trigger $env:GITHUB_EVENT_NAME