Skip to content

Commit

Permalink
pass in token
Browse files Browse the repository at this point in the history
  • Loading branch information
ahernandez411 committed Feb 5, 2024
1 parent 0e60e5f commit dabbe5f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
if: always()
uses: ./
with:
github-pat: ${{ secrets.GITHUB_TOKEN }}
save-to-artifact: "true"
save-to-branch: "false"
save-to-wiki: "false"
Expand Down
14 changes: 13 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ inputs:
save-to-wiki:
description: If true, save to documentation to repository's wiki
required: true
github-pat:
description: The github personal access token used for interactions with github
required: true

permissions:
contents: write
wikis: write

runs:
using: composite
Expand Down Expand Up @@ -42,6 +49,7 @@ runs:
with:
repository: ${{ github.repository }}.wiki
path: wiki
token: ${{ inputs.github-pat }}

- name: Document Workflows
shell: python
Expand Down Expand Up @@ -289,7 +297,9 @@ runs:
cd wiki
git config --global user.name "action-workflow-documenter"
git config --global user.email "action-workflow-documenter@users.noreply.github.com"
git add .
git remote set-url origin https://x-access-token:${{ inputs.github-pat }}@github.com/$GITHUB_REPOSITORY
git add .
git diff-index --quiet HEAD || git commit -m "Update wiki with latest workflow documentation" && git push
- name: Save Changes to Branch
Expand All @@ -299,6 +309,8 @@ runs:
set -x
git config --global user.name "action-workflow-documenter"
git config --global user.email "action-workflow-documenter@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ inputs.github-pat }}@github.com/$GITHUB_REPOSITORY
git add .
git checkout -b actions-documentation
git commit -m "Add actions documentation"
Expand Down

0 comments on commit dabbe5f

Please sign in to comment.