Skip to content

Commit 8d19ae3

Browse files
committed
use $GITHUB_OUTPUT
1 parent 5eae029 commit 8d19ae3

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

.github/workflows/SetupBranch.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@ on:
1515
jobs:
1616
CreateTempBranch:
1717
runs-on: ubuntu-latest
18+
outputs:
19+
target_branch: ${{ steps.output.outputs.target_branch }}
1820
steps:
1921
- name: Create Branch
2022
uses: peterjgrainger/action-create-branch@v2.2.0
2123
env:
2224
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2325
with:
2426
branch: ${{ inputs.target_branch }}
27+
- name: Set output
28+
id: output
29+
run: |
30+
echo "target_branch=${{ inputs.target_branch }}" >> $GITHUB_OUTPUT
2531
2632
UpdateOnNewBranch:
2733
needs: CreateTempBranch
@@ -31,10 +37,10 @@ jobs:
3137
uses: actions/checkout@v3
3238
- name: Call NewUpdate
3339
run: |
34-
version_input=""
3540
if [ -n "${{ inputs.sirius_version }}" ]; then
36-
version_input="-f sirius_version=${{ inputs.sirius_version }}"
41+
gh workflow run NewUpdate.yml --ref ${{ inputs.target_branch }} -f target_branch=${GITHUB_REF##*/} -f sirius_version=${{ inputs.sirius_version }}
42+
else
43+
gh workflow run NewUpdate.yml --ref ${{ inputs.target_branch }} -f target_branch=${GITHUB_REF##*/}
3744
fi
38-
gh workflow run NewUpdate.yml --ref ${{ inputs.target_branch }} -f target_branch=${GITHUB_REF##*/} $version_input
3945
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/updater.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,21 @@ on:
1212
jobs:
1313
UpdateOnNewBranch:
1414
runs-on: ubuntu-latest
15+
outputs:
16+
target_branch: ${{ steps.setup.outputs.target_branch }}
1517
steps:
1618
- name: checkout repo
1719
uses: actions/checkout@v3
1820
- name: Call SetupBranch
21+
id: setup
1922
run: |
20-
version_input=""
23+
target_branch=$(echo -en temp_;date +"%Y%m%d%H%M%S%N")
24+
echo "target_branch=$target_branch" >> $GITHUB_OUTPUT
25+
2126
if [ -n "${{ inputs.sirius_version }}" ]; then
22-
version_input="-f sirius_version=${{ inputs.sirius_version }}"
27+
gh workflow run SetupBranch.yml --ref ${GITHUB_REF##*/} -f target_branch=$target_branch -f sirius_version=${{ inputs.sirius_version }}
28+
else
29+
gh workflow run SetupBranch.yml --ref ${GITHUB_REF##*/} -f target_branch=$target_branch
2330
fi
24-
gh workflow run SetupBranch.yml --ref ${GITHUB_REF##*/} -f target_branch=$(echo -en temp_;date +"%Y%m%d%H%M%S%N") $version_input
2531
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)