Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/scripts/release-tag.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,15 @@ else
fails=$((fails + 1))
fi

# workflows: write lets GitHub create a tag at a commit whose workflow tree matches no branch tip.
token='.jobs.mint.steps[] | select(.name == "Create scoped release App token") | .with'
if [ "$(yq -r "$token | keys | map(select(test(\"^permission-\"))) | sort | join(\",\")" "$workflow")" = permission-contents,permission-workflows ] \
&& [ "$(yq -r "$token | .\"permission-contents\"" "$workflow")" = write ] \
&& [ "$(yq -r "$token | .\"permission-workflows\"" "$workflow")" = write ]; then
echo 'ok mint token has contents and workflows write only'
else
echo 'FAIL mint token has contents and workflows write only'
fails=$((fails + 1))
fi

[ "$fails" -eq 0 ]
1 change: 1 addition & 0 deletions .github/workflows/release-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
client-id: ${{ vars.AUTOMATION_APP_CLIENT_ID }}
private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
permission-contents: write
permission-workflows: write
repositories: nix2container

- name: Mint release tag if needed
Expand Down
Loading