Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit 6b6b0df

Browse files
galarghmasihmarten-seemannlaurentsenta
authored
Unified CI Release - 2023-02-08 (#466)
* Add option to skip `32-bit` go test (#412) Introduce an option to configure `go-test` to allow completely skipping `32-bit` tests. Fixes #388 * Run at most 1 dispatch job per ref (#414) * fix: check if git tag returns any results (#415) * make go generate print the commands it executs (#440) * use pull_request_target event for release-check workflow (#295) * Revert "include cross-package coverage in codecov" * Revert "Revert "include cross-package coverage in codecov"" * Make automerge a reusable workflow (#260) * move automerge from template to workflows * make automerge reusable and use it from new automerge template * pass parent job name to reusable automerge * check github actions yamls (#272) * check github actions yamls * make yaml linter happy about go-test * mention VS Code YAML extension in the readme * add info about other YAML checking extensions * make yaml checker more generic * use validate-yaml-schema action from mainline (#277) * upgrade lewagon/wait-on-check-action to v1.1.1 (#278) * always add a version.json file if it doesn't exist (#281) * fix go-test runner string * check if tag already exists in release-check (#287) * allow specifying custom PATH for 386 arch (#289) * use pull_request_target event for release-check workflow * add comment on missing version.json * chore: revert release checker path trigger change * chore: add footnote when non-docs files are modified with the release * fix: prev version calculation * feat: allow configuring custom go-test runners (#443) * feat: allow configuring custom go-test runners * docs: update readme to include info on configuration variables * feat: allow skipping go-test on certain OSes (#455) * feat: standarise JSON config reading * feat: allow skipping go-test on certain OSes * fix: go-test conditional * chore: show config after extracting it * chore: udpate actions and go modules (#458) * fix: source read-config from next for now * simplify Go version upgrade procedure (#280) * chore: simplify Go version upgrade procedure * chore: add default for the go-version input of release-check * Update .github/actions/copy-workflow-go/action.yml * Update configs/README.md Co-authored-by: Laurent Senta <[email protected]> --------- Co-authored-by: Laurent Senta <[email protected]> * Go through all the workflows and clean them up ahead of the next major release (#462) * chore: clean up deprecated set-output * chore: do not use substitution inside run * chore: do not use substitution in if * chore: skip env var brakets where possible * fix: env var substitution * fix: double toJSON * Update templates/.github/workflows/js-test-and-release.yml * feat: create gh releases in release-check/releaser workflows (#456) * feat: create gh releases in release-check/releaser workflows * fix: fill expr in release check workflow * fix: add missing gh token in release check * fix: add missing prev version env var in release check workflow * fix: release check in release check * chore: clean up obsolete step from releaser * fix: step outputs in release workflows * fix: labels in releaser * fix: action gh release * update go version to 1.20.x (#463) * update go version to 1.20.x * fix: go 1.20 upgrade * Revert "fix: go 1.20 upgrade" This reverts commit ceb72ef. * clean up where source ref was set to next (#464) * perform self-review before final release --------- Co-authored-by: Masih H. Derkani <[email protected]> Co-authored-by: Marten Seemann <[email protected]> Co-authored-by: Laurent Senta <[email protected]>
1 parent 132979c commit 6b6b0df

File tree

21 files changed

+357
-224
lines changed

21 files changed

+357
-224
lines changed

.github/actions/copy-workflow-go/action.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,34 @@ description: Copy workflow steps specific to go
44
runs:
55
using: "composite"
66
steps:
7+
# GitHub Actions Expressions do not support last item access/array length retrieval
8+
- id: go
9+
run: echo "version=$(jq -r '.[-1]' <<< '${{ toJSON(matrix.cfg.go.versions) }}')" >> $GITHUB_OUTPUT
10+
shell: bash
711
- uses: actions/setup-go@v3
812
with:
913
# This should be the same Go version we use in the go-check workflow.
1014
# go mod tidy, go vet, staticcheck and gofmt might behave differently depending on the version.
11-
go-version: "1.19.x"
15+
go-version: ${{ steps.go.outputs.version }}
1216
- name: bump go.mod go version if needed
1317
uses: protocol/[email protected]
18+
env:
19+
VERSION: ${{ matrix.cfg.go.versions[0] }}
1420
with:
1521
working-directory: ${{ env.TARGET_REPO_DIR }}
1622
run: |
1723
# We want our modules to support two Go versions at a time.
18-
# As of August 2022, Go 1.19 is the latest stable.
1924
# go.mod's Go version declares the language version being used.
2025
# As such, it has to be the minimum of all Go versions supported.
21-
# Bump this every six months, as new Go versions come out.
22-
TARGET_VERSION=1.18
23-
PREVIOUS_TARGET_VERSION=1.17
26+
TARGET_VERSION="$VERSION"
27+
TARGET_VERSION="${TARGET_VERSION%.x}"
28+
TARGET_MAJOR_VERSION="${TARGET_VERSION%.[0-9]*}"
29+
TARGET_MINOR_VERSION="${TARGET_VERSION#[0-9]*.}"
30+
# Assumptions:
31+
# - all versions are targetted incrementally
32+
# - no versions are skipped
33+
# - patch version is never pinned explicitly
34+
PREVIOUS_TARGET_VERSION="$TARGET_MAJOR_VERSION.$(($TARGET_MINOR_VERSION-1))"
2435
2536
# Note that the "<" comparison doesn't understand semver,
2637
# but it should be good enough for the foreseeable future.
@@ -50,18 +61,18 @@ runs:
5061
# As of Go 1.19 io/ioutil is deprecated
5162
# We automate its upgrade here because it is quite a widely used package
5263
while read file; do
53-
sed -i 's/ioutil.NopCloser/io.NopCloser/' "${file}";
54-
sed -i 's/ioutil.ReadAll/io.ReadAll/' "${file}";
64+
sed -i 's/ioutil.NopCloser/io.NopCloser/' "$file";
65+
sed -i 's/ioutil.ReadAll/io.ReadAll/' "$file";
5566
# ReadDir replacement might require manual intervention (https://pkg.go.dev/io/ioutil#ReadDir)
56-
sed -i 's/ioutil.ReadDir/os.ReadDir/' "${file}";
57-
sed -i 's/ioutil.ReadFile/os.ReadFile/' "${file}";
58-
sed -i 's/ioutil.TempDir/os.MkdirTemp/' "${file}";
59-
sed -i 's/ioutil.TempFile/os.CreateTemp/' "${file}";
60-
sed -i 's/ioutil.WriteFile/os.WriteFile/' "${file}";
61-
sed -i 's/ioutil.Discard/io.Discard/' "${file}";
67+
sed -i 's/ioutil.ReadDir/os.ReadDir/' "$file";
68+
sed -i 's/ioutil.ReadFile/os.ReadFile/' "$file";
69+
sed -i 's/ioutil.TempDir/os.MkdirTemp/' "$file";
70+
sed -i 's/ioutil.TempFile/os.CreateTemp/' "$file";
71+
sed -i 's/ioutil.WriteFile/os.WriteFile/' "$file";
72+
sed -i 's/ioutil.Discard/io.Discard/' "$file";
6273
done <<< "$(find . -type f -name '*.go')"
6374
64-
go install golang.org/x/tools/cmd/goimports@v0.1.12
75+
go install golang.org/x/tools/cmd/goimports@v0.5.0
6576
goimports -w .
6677
6778
git add .
@@ -70,7 +81,7 @@ runs:
7081
fi
7182
fi
7283
- name: go mod tidy (on initial workflow deployment)
73-
if: ${{ env.INITIAL_WORKFLOW_DEPLOYMENT == 1 }}
84+
if: env.INITIAL_WORKFLOW_DEPLOYMENT == 1
7485
uses: protocol/[email protected]
7586
with:
7687
working-directory: ${{ env.TARGET_REPO_DIR }}
@@ -81,7 +92,7 @@ runs:
8192
git commit -m "run go mod tidy"
8293
fi
8394
- name: gofmt -s (on initial workflow deployment and on new Go version)
84-
if: ${{ env.INITIAL_WORKFLOW_DEPLOYMENT == 1 || env.GO_VERSION_BUMP == 1}}
95+
if: env.INITIAL_WORKFLOW_DEPLOYMENT == 1 || env.GO_VERSION_BUMP == 1
8596
working-directory: ${{ env.TARGET_REPO_DIR }}
8697
shell: bash
8798
run: |
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: read config
2+
description: Reads workflow config
3+
4+
outputs:
5+
json:
6+
description: JSON config
7+
value: ${{ steps.config.outputs.json }}
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- id: config
13+
run: |
14+
eof="EOF$RANDOM"
15+
path="${GITHUB_WORKFLOW_REF%.yml@*}"
16+
path="./${path#*/*/}-config.json"
17+
printf "json<<$eof\n%s\n$eof" "$(cat "$path" || echo '{}')" >> $GITHUB_OUTPUT
18+
shell: bash
19+
- env:
20+
CONFIG: ${{ steps.config.outputs.json }}
21+
run: echo "$CONFIG"
22+
shell: bash

.github/workflows/add-label-by-query.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- name: Add label by query
2424
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
GITHUB_TOKEN: ${{ github.token }}
2626
QUERY: ${{ github.event.inputs.query }}
2727
LABEL: ${{ github.event.inputs.label }}
2828
DRY_RUN: ${{ github.event.inputs.dry-run }}

.github/workflows/automerge.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@ jobs:
2121
fetch-depth: 0
2222
- name: Check if we should automerge
2323
id: should-automerge
24+
env:
25+
BASE_REF: ${{ github.event.pull_request.base.ref }}
26+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
2427
run: |
25-
for commit in $(git rev-list --first-parent origin/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.sha }}); do
28+
for commit in $(git rev-list --first-parent origin/$BASE_REF..$HEAD_SHA); do
2629
committer=$(git show --format=$'%ce' -s $commit)
2730
echo "Committer: $committer"
2831
if [[ "$committer" != "[email protected]" ]]; then
2932
echo "Commit $commit wasn't committed by web3-bot, but by $committer."
30-
echo "::set-output name=status::false"
33+
echo "status=false" >> $GITHUB_OUTPUT
3134
exit
3235
fi
3336
done
34-
echo "::set-output name=status::true"
37+
echo "status=true" >> $GITHUB_OUTPUT
3538
automerge:
3639
needs: automerge-check
3740
runs-on: ubuntu-latest
@@ -40,16 +43,16 @@ jobs:
4043
if: github.event.pull_request.user.login == 'web3-bot' && needs.automerge-check.outputs.status == 'true'
4144
steps:
4245
- name: Wait on tests
43-
uses: lewagon/wait-on-check-action@752bfae19aef55dab12a00bc36d48acc46b77e9d # v1.1.1
46+
uses: lewagon/wait-on-check-action@3a563271c3f8d1611ed7352809303617ee7e54ac # v1.2.0
4447
with:
4548
ref: ${{ github.event.pull_request.head.sha }}
46-
repo-token: ${{ secrets.GITHUB_TOKEN }}
49+
repo-token: ${{ github.token }}
4750
wait-interval: 10
4851
running-workflow-name: '${{ inputs.job }} / ${{ github.job }}' # the name of the check for this job
4952
- name: Merge PR
50-
uses: pascalgn/automerge-action@741c311a47881be9625932b0a0de1b0937aab1ae # v0.13.1
53+
uses: pascalgn/automerge-action@eb68b061739cb9d81564f8e812d0b3c45f0fb09a # v0.15.5
5154
env:
52-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
55+
GITHUB_TOKEN: "${{ github.token }}"
5356
MERGE_LABELS: ""
5457
MERGE_METHOD: "squash"
5558
MERGE_DELETE_BRANCH: true

.github/workflows/check-3rd-party.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ jobs:
1515
- id: set-matrix
1616
run: |
1717
TARGETS=$(find . -type f -name "*.yml" | sed "s|^\./||" | grep -v workflow-templates/header.yml | jq -R -s -c 'split("\n")[:-1]')
18-
echo "::set-output name=targets::$TARGETS"
18+
echo "targets=$TARGETS" >> $GITHUB_OUTPUT
1919
check:
2020
needs: [ matrix ]
2121
runs-on: ubuntu-latest
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
file: ${{ fromJson(needs.matrix.outputs.targets) }}
25+
file: ${{ fromJSON(needs.matrix.outputs.targets) }}
2626
name: ${{ matrix.file }}
2727
steps:
2828
- uses: actions/checkout@v3
2929
- name: Run check
30-
run: .github/workflows/check-3rd-party.sh ${{ matrix.file }}
30+
env:
31+
FILE: ${{ matrix.file }}
32+
run: .github/workflows/check-3rd-party.sh $FILE

.github/workflows/check-yaml.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
- uses: nwisbeta/validate-yaml-schema@c3734e647d2a3beb98b9132330067e900fdbd1a2 # v2.0.0
16+
- uses: pl-strflt/validate-yaml-schema@21116b89ed801672cb7354717c0d049974f265b0
1717
with:
1818
yamlSchemasJson: |
1919
{

.github/workflows/copy-workflow.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
cfg: ${{ fromJson(github.event.inputs.targets) }}
18+
cfg: ${{ fromJSON(github.event.inputs.targets) }}
1919
max-parallel: 10
2020
env:
2121
TARGET_REPO_DIR: "target-repo"
@@ -53,40 +53,40 @@ jobs:
5353
- name: determine files to add
5454
# By setting the environment variable, it's possible to programmatically add / modify this list.
5555
# See https://github.com/protocol/.github/blob/38135c75e47839623bf9b2748275d8c6167a8fa8/.github/workflows/copy-workflow.yml#L163-L168 for an example, how we used to make use of this.
56-
run: |
57-
files=${{ toJson(toJson(matrix.cfg.files)) }}
58-
extra_files=${{ toJson(toJson(matrix.cfg.extra_files)) }}
59-
files=$(echo -e "$files" "$extra_files" | jq -nc '[inputs] | add')
60-
echo "FILES=$files" >> $GITHUB_ENV
56+
env:
57+
FILES: |
58+
${{ toJSON(matrix.cfg.files) }}
59+
${{ toJSON(matrix.cfg.extra_files) }}
60+
run: echo "FILES=$(jq -nc '[inputs] | add' <<< "$FILES")" >> $GITHUB_ENV
6161
- name: is initial workflow deployment
6262
# INITIAL_WORKFLOW_DEPLOYMENT=1 iff none of the files in the target repository exist yet
6363
run: |
6464
initial_workflow_deployment=1
65-
for f in $(jq -r '.[]' <<< ${{ toJson(env.FILES) }}); do
65+
for f in $(jq -r '.[]' <<< "$FILES"); do
6666
if [[ -f $TARGET_REPO_DIR/$f ]]; then
6767
initial_workflow_deployment=0
6868
break
6969
fi
7070
done
7171
echo "INITIAL_WORKFLOW_DEPLOYMENT=$initial_workflow_deployment" >> $GITHUB_ENV
7272
- name: remove Travis (on initial workflow deployment)
73-
if: ${{ env.INITIAL_WORKFLOW_DEPLOYMENT == 1 }}
73+
if: env.INITIAL_WORKFLOW_DEPLOYMENT == 1
7474
working-directory: ${{ env.TARGET_REPO_DIR }}
7575
run: |
7676
if [[ -f .travis.yml ]]; then
7777
git rm .travis.yml
7878
git commit -m "disable Travis"
7979
fi
8080
- name: remove CircleCI (on initial workflow deployment)
81-
if: ${{ env.INITIAL_WORKFLOW_DEPLOYMENT == 1 }}
81+
if: env.INITIAL_WORKFLOW_DEPLOYMENT == 1
8282
working-directory: ${{ env.TARGET_REPO_DIR }}
8383
run: |
8484
if [[ -d .circleci ]]; then
8585
git rm -r .circleci
8686
git commit -m "disable CircleCI"
8787
fi
8888
- name: remove gx (on initial workflow deployment)
89-
if: ${{ env.INITIAL_WORKFLOW_DEPLOYMENT == 1 }}
89+
if: env.INITIAL_WORKFLOW_DEPLOYMENT == 1
9090
working-directory: ${{ env.TARGET_REPO_DIR }}
9191
run: |
9292
if [[ -d .gx ]]; then
@@ -111,7 +111,7 @@ jobs:
111111
}
112112
TEMPLATE_ENGINE: s#\$\{\{\{\s*(.*?)\s*\}\}\}#`jq -cjn 'env.CONTEXT | fromjson.$1'`#ge
113113
run: |
114-
for f in $(jq -r '.[]' <<< ${{ toJson(env.FILES) }}); do
114+
for f in $(jq -r '.[]' <<< "$FILES"); do
115115
echo -e "\nProcessing $f."
116116
# add DO NOT EDIT header
117117
tmp=$(mktemp)
@@ -144,7 +144,7 @@ jobs:
144144
working-directory: ${{ env.TARGET_REPO_DIR }}
145145
run: echo "NEEDS_UPDATE=$(git rev-list HEAD...origin/$(git rev-parse --abbrev-ref HEAD) --ignore-submodules --count 2> /dev/null || echo 1)" >> $GITHUB_ENV
146146
- name: Force push web3-bot/sync branch
147-
if: ${{ env.NEEDS_UPDATE != 0 }}
147+
if: env.NEEDS_UPDATE != 0
148148
working-directory: ${{ env.TARGET_REPO_DIR }}
149149
run: |
150150
git checkout -B web3-bot/sync

.github/workflows/create-prs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ jobs:
2828
done
2929
failed=()
3030
for target in ${targets[@]}; do
31-
echo "Processing ${target}"
32-
base="$(gh api "/repos/${target}" --jq '.default_branch')"
31+
echo "Processing $target"
32+
base="$(gh api "/repos/$target" --jq '.default_branch')"
3333
# checks if a PR needs to be created
34-
if [[ "$(gh api -X GET "/repos/${target}/compare/${base}...${{ env.PR_BRANCH }}" --jq '.status')" == 'ahead' ]]; then
35-
if [[ "$(gh api -X GET "/repos/${target}/pulls" -f head="$(echo "${target}" | cut -d/ -f1):${{ env.PR_BRANCH }}" -f base="$base" --jq 'length')" != '0' ]] ; then
34+
if [[ "$(gh api -X GET "/repos/$target/compare/$base...$PR_BRANCH" --jq '.status')" == 'ahead' ]]; then
35+
if [[ "$(gh api -X GET "/repos/$target/pulls" -f head="$(echo "$target" | cut -d/ -f1):$PR_BRANCH" -f base="$base" --jq 'length')" != '0' ]] ; then
3636
echo "The PR already exists. Skipping."
3737
continue
3838
fi
3939
else
40-
echo "The branch does not exist or has diverged from ${base}. Skipping."
40+
echo "The branch does not exist or has diverged from $base. Skipping."
4141
continue
4242
fi
4343
# tries to create a PR in target
@@ -47,7 +47,7 @@ jobs:
4747
pr_create_cooldown_in_seconds=1
4848
# max cumulative sleep time - 68.25 minutes
4949
while true; do
50-
if result="$(gh api "/repos/$target/pulls" -f title="${{ env.PR_TITLE }}" -f head="${{ env.PR_BRANCH }}" -f base="$base")"; then
50+
if result="$(gh api "/repos/$target/pulls" -f title="$PR_TITLE" -f head="$PR_BRANCH" -f base="$base")"; then
5151
echo "Successfully created a PR for '$target' ($pr_create_attempt/$pr_create_max_attempts)"
5252
echo "Sleeping for $pr_create_cooldown_in_seconds seconds before creating a next one"
5353
sleep $pr_create_cooldown_in_seconds

.github/workflows/dispatch.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
branches: [ master, testing ]
1010
workflow_dispatch:
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
env:
1317
# Number of repositories in a batch.
1418
# Matrix jobs within a copy workflow run are run in parallel.
@@ -48,8 +52,8 @@ jobs:
4852
targets+=($(jq -c ".repositories[] | $defaults + ." $config))
4953
echo "::endgroup::"
5054
done
51-
batches=$(jq -sc '[. | _nwise(${{ env.MAX_REPOS_PER_WORKFLOW }})] | to_entries' <<< "${targets[@]}")
52-
echo "::set-output name=batches::$batches"
55+
batches=$(jq -sc "[. | _nwise($MAX_REPOS_PER_WORKFLOW)] | to_entries" <<< "${targets[@]}")
56+
echo "batches=$batches" >> $GITHUB_OUTPUT
5357
dispatch:
5458
needs: [ matrix ]
5559
name: Dispatch copy workflow(batch ${{ matrix.cfg.key }})
@@ -69,7 +73,7 @@ jobs:
6973
# The triggered copy workflow runs use that final array as their matrix.
7074
# Since max-parallel here is 1, we'll end up with at most max-parallel from copy workflow + 1 parallel jobs.
7175
# 20 is the upper limit on parallel jobs on a free plan.
72-
cfg: ${{ fromJson(needs.matrix.outputs.batches) }}
76+
cfg: ${{ fromJSON(needs.matrix.outputs.batches) }}
7377
max-parallel: 1
7478
env:
7579
GITHUB_TOKEN: ${{ secrets.WEB3BOT_GITHUB_TOKEN }}
@@ -78,31 +82,36 @@ jobs:
7882
steps:
7983
- id: dispatch
8084
name: Dispatch copy workflow
85+
env:
86+
TARGETS: ${{ toJSON(matrix.cfg.value) }}
8187
run: |
8288
start_date="$(date +%s)"
83-
# 2 toJson calls are needed to turn the array of targets into a string
84-
echo '{"targets":${{ toJson(toJson(matrix.cfg.value)) }}}' | jq -c '.' | gh workflow run "${{ env.WORKFLOW_YML }}" --ref "${{ github.ref }}" --repo "${{ env.WORKFLOW_REPO }}" --json
85-
echo "::set-output name=start_date::$start_date"
89+
gh workflow run "$WORKFLOW_YML" --ref "$GITHUB_REF" --repo "$WORKFLOW_REPO" --field "targets=$TARGETS"
90+
echo "start_date=$start_date" >> $GITHUB_OUTPUT
8691
- id: run
8792
name: Wait for copy workflow run to start
93+
env:
94+
START_DATE: ${{ steps.dispatch.outputs.start_date }}
8895
run: |
8996
# checks every 3 seconds until the most recent copy workflow run's created_at is later than this job's start_date
9097
while sleep 3; do
91-
run="$(gh api "/repos/${{ env.WORKFLOW_REPO }}/actions/workflows/${{ env.WORKFLOW_YML }}/runs?per_page=1" --jq '.workflow_runs[0]')"
98+
run="$(gh api "/repos/$WORKFLOW_REPO/actions/workflows/$WORKFLOW_YML/runs?per_page=1" --jq '.workflow_runs[0]')"
9299
# nothing to check if no copy workflow run was returned
93100
if [[ ! -z "$run" ]]; then
94101
run_start_date="$(date --date="$(jq -r '.created_at' <<< "$run")" +%s)"
95-
if [[ "$run_start_date" > "${{ steps.dispatch.outputs.start_date }}" ]]; then
96-
echo "::set-output name=id::$(jq -r '.id' <<< "$run")"
102+
if [[ "$run_start_date" > "$START_DATE" ]]; then
103+
echo "id=$(jq -r '.id' <<< "$run")" >> $GITHUB_OUTPUT
97104
break
98105
fi
99106
fi
100107
done
101108
- name: Wait for copy workflow run to complete
109+
env:
110+
RUN_ID: ${{ steps.run.outputs.id }}
102111
run: |
103112
# delays checking copy workflow's run status to save on GH API requests
104-
sleep ${{ env.WORKFLOW_COMPLETION_CHECK_DELAY }}
113+
sleep $WORKFLOW_COMPLETION_CHECK_DELAY
105114
106115
# checks every 3 seconds until the copy workflow run's status is completed
107116
# redirects the stdout to /dev/null because it is very chatty
108-
gh run watch "${{ steps.run.outputs.id }}" --repo "${{ env.WORKFLOW_REPO }}" > /dev/null
117+
gh run watch "$RUN_ID" --repo "$WORKFLOW_REPO" > /dev/null

0 commit comments

Comments
 (0)