Skip to content

Commit

Permalink
fix: github pat in documentation examples (#423)
Browse files Browse the repository at this point in the history
* fix: github pat in documentation examples

Signed-off-by: David Calvert <david@0xdc.me>

* docs: 📝 (#422) add missing GITHUB_TOKEN permissions

* fix:  (#422) add missing job permissions out of convenience reasons

---------

Signed-off-by: David Calvert <david@0xdc.me>
Co-authored-by: andy Augustin <AndreasAugustin@users.noreply.github.com>
Co-authored-by: Andy Augustin <dev@andreas-augustin.org>
  • Loading branch information
3 people authored Dec 30, 2023
1 parent ba2b26d commit aea6128
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/actions_template_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
jobs:
repo-sync:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
# To use this repository's private action, you must check out the repository
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
call_test_all:
uses: ./.github/workflows/test_all.yml
secrets: inherit
permissions:
contents: write
pull-requests: write
call_release_please:
needs:
- call_shellcheck
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:
jobs:
test-implementation-job:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/test_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,24 @@ jobs:
call_test_hooks:
uses: ./.github/workflows/test_hooks.yml
secrets: inherit
permissions:
contents: write
pull-requests: write
call_test_ssh_gitlab:
uses: ./.github/workflows/test_ssh_gitlab.yml
secrets: inherit
permissions:
contents: write
pull-requests: write
call_test_ssh:
uses: ./.github/workflows/test_ssh.yml
secrets: inherit
permissions:
contents: write
pull-requests: write
call_test:
uses: ./.github/workflows/test.yml
secrets: inherit
permissions:
contents: write
pull-requests: write
4 changes: 3 additions & 1 deletion .github/workflows/test_hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:
jobs:
test-implementation-job:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test_ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:
jobs:
test-implementation-job:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test_ssh_gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:
jobs:
test-implementation-job:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
Expand Down
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,20 @@ on:
jobs:
repo-sync:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: write
pull-requests: write

steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: actions-template-sync
uses: AndreasAugustin/actions-template-sync@v1.1.3
uses: AndreasAugustin/actions-template-sync@v1.1.8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_repo_path: <owner/repo>
Expand Down Expand Up @@ -117,12 +124,14 @@ jobs:
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}

- name: actions-template-sync
uses: AndreasAugustin/actions-template-sync@v1.1.3
uses: AndreasAugustin/actions-template-sync@v1.1.8
with:
github_token: ${{ steps.generate_token.outputs.token }}
source_repo_path: <owner/repo>
Expand All @@ -144,13 +153,20 @@ It is also possible to use a different git provider, e.g. GitLab.
jobs:
repo-sync:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: write
pull-requests: write
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: actions-template-sync
uses: AndreasAugustin/actions-template-sync@v1.1.3
uses: AndreasAugustin/actions-template-sync@v1.1.8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_repo_path: ${{ secrets.SOURCE_REPO_PATH }} # <owner/repo>, should be within secrets
Expand Down Expand Up @@ -197,14 +213,13 @@ jobs:
steps:
# To use this repository's private action, you must check out the repository
-
name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.CUSTOM_GITHUB_PAT }}
-
name: Test action step PAT
uses: AndreasAugustin/actions-template-sync@v1.1.0
- name: Test action step PAT
uses: AndreasAugustin/actions-template-sync@v1.1.8
with:
github_token: ${{ secrets.CUSTOM_GITHUB_PAT }}
source_repo_path: ${{ secrets.SOURCE_REPO_PATH }} # <owner/repo>, should be within secrets
Expand Down

0 comments on commit aea6128

Please sign in to comment.