Skip to content

Commit

Permalink
.github/workflows: use the personal access token to create releases
Browse files Browse the repository at this point in the history
"When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run."

https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
  • Loading branch information
roberth-k committed Dec 8, 2022
1 parent 90669a1 commit df1659c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/contribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
mv $tmp docsets/AWS_CDK/docset.json
- name: Configure git
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.PAT }}
run: |
gh auth status
gh auth setup-git
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Push target branch
id: push
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.PAT }}
run: |
readonly gh_login=$(gh api /user | jq -r .login)
git add -A
Expand All @@ -100,7 +100,7 @@ jobs:
steps:
- name: Create pull request
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.PAT }}
run: |
readonly release_version=${{ needs.push.outputs.release_version }}
readonly pr_head=${{ needs.push.outputs.pr_head }}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,24 @@ jobs:
runs-on: ubuntu-22.04
permissions:
actions: read
contents: write
contents: read
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/download-artifact@v3
with:
name: AWS-CDK.tgz
- run: |
- name: Extract docset version
run: |
tar \
--extract \
--file=AWS-CDK.tgz \
--strip-components=4 \
AWS-CDK.docset/Contents/Resources/Documents/cdk-version
- run: |
- name: Create new release
env:
GH_TOKEN: ${{ secrets.PAT }}
run: |
tag="v$(cat cdk-version)-$(date +%s)"
gh release create \
--repo=$GITHUB_REPOSITORY \
Expand Down

0 comments on commit df1659c

Please sign in to comment.