File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 release :
44 types : [created]
55 workflow_call :
6+ inputs :
7+ ref :
8+ required : false
9+ type : string
610 workflow_dispatch :
711
812jobs :
1115 runs-on : ubuntu-latest
1216 permissions :
1317 contents : read
18+ outputs :
19+ ref : ${{ steps.ref_finder.outputs.ref }}
1420 steps :
21+ - name : Find ref to build/publish
22+ id : ref_finder
23+ run : |
24+ if [[ ! -z "${{ inputs.ref }} ]]; then echo "ref=${{ inputs.ref }}" >> $GITHUB_OUTPUT
25+ else echo "ref=${{ github.sha }}" >> $GITHUB_OUTPUT
1526 - uses : actions/checkout@v4
27+ with :
28+ ref : ${{ steps.ref_finder.outputs.ref }}
1629 - uses : actions/setup-python@v5
1730 with :
1831 cache : ' pip'
3649 id-token : write
3750 steps :
3851 - uses : actions/checkout@v4
52+ with :
53+ ref : ${{ needs.build.outputs.ref }}
3954 - uses : actions/setup-node@v4
4055 with :
4156 node-version : 20
5368 packages : write
5469 steps :
5570 - uses : actions/checkout@v4
71+ with :
72+ ref : ${{ needs.build.outputs.ref }}
5673 - uses : actions/setup-node@v4
5774 with :
5875 node-version : 20
6885 contents : read
6986 steps :
7087 - uses : actions/checkout@v4
88+ with :
89+ ref : ${{ needs.build.outputs.ref }}
7190 - run : curl "https://www.webjars.org/deploy?webJarType=npm&nameOrUrlish=tag2link&version=$(jq -r '.version' package.json)"
7291
Original file line number Diff line number Diff line change 3434 if [ $(git diff --name-only | wc -l) -gt 0 ]; then
3535 tag=$(jq -r '.version' package.json)
3636 # The GH api only allows for single file commits right now
37+ # https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents
3738 for file in $(git diff --name-only); do
3839 gh api --method PUT -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
3940 "/repos/${{ github.repository }}/contents/$file" \
5657 GH_TOKEN : ${{ github.token }}
5758 outputs :
5859 release_needed : ${{ steps.tag.outputs.release_needed }}
60+ tag : ${{ steps.tag.outputs.tag }}
5961 steps :
6062 - uses : actions/checkout@v4
6163 with :
9092 --field "sha=${object}"
9193 gh release create ${tag} --generate-notes
9294 echo "release_needed=true" >> "$GITHUB_OUTPUT"
95+ echo "tag=${tag}" >> $GITHUB_OUTPUT
9396 else
9497 echo "release_needed=false" >> "$GITHUB_OUTPUT"
9598 fi
98101 if : needs.tag.outputs.release_needed
99102 uses : ./.github/workflows/release.yaml
100103 secrets : inherit
104+ with :
105+ ref : ${{ needs.tag.outputs.tag }}
101106 permissions :
102107 attestations : write
103108 contents : read
You can’t perform that action at this time.
0 commit comments