Skip to content

Commit

Permalink
pass gh token through to use in script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Otey committed May 26, 2022
1 parent 4fc92db commit 622bc6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ runs:
DOCS_REPOSITORY_PATH: ${{ inputs.docs-repository-path}}
GITHUB_ACTOR: ${{ github.repository }}
GITHUB_WORKSPACE: ${{ github.workspace }}
GITHUB_TOKEN: ${{ inputs.docs-repository-token-variable }}
6 changes: 6 additions & 0 deletions dependadoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -eo pipefail
# DOCS_REPOSITORY_PATH: ${{ inputs.docs-repository-path}}
# GITHUB_ACTOR: ${{ github.repository }}
# GITHUB_WORKSPACE: ${{ github.workspace }}
# GITHUB_TOKEN: ${{ inputs.docs-repository-token-variable }}

# get mirrored repo name (no owner)
MIRRORED_REPO=$(echo ${MIRRORED_REPOSITORY_FULL_NAME##*/})
Expand All @@ -38,6 +39,7 @@ FILE_LIST=$(git status --porcelain)

# exit if file list indicates there are no changes
if [ -z "$FILE_LIST" ]; then
echo "No changes found to mirrored documentation, exiting."
exit
fi

Expand All @@ -55,6 +57,10 @@ The following files were modified:
$FILE_LIST
EOF

# authenticate
gh auth login --with-token $GITHUB_TOKEN

# create PR
gh pr create \
--title "Dependadoc PR from $MIRRORED_REPO (source ./$MIRRORED_FOLDER)" \
--body "$BODY" \
Expand Down

0 comments on commit 622bc6d

Please sign in to comment.