Merge pull request #3455 from Elv13/token

ci: Cleanup the previous test commits.
This commit is contained in:
Emmanuel Lepage Vallée 2021-10-14 12:06:09 -07:00 committed by GitHub
commit 5a27eaa973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -10,7 +10,7 @@
echo "Post-processing (API) documentation." echo "Post-processing (API) documentation."
echo "PR Number: $PR_NUMBER" echo "PR Number: $PR_NUMBER"
echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF" echo "GITHUB_HEAD_REF: $GITHUB_REF"
if [ -z "$APIDOC_TOKEN" ]; then if [ -z "$APIDOC_TOKEN" ]; then
echo "No APIDOC_TOKEN available. Skipping." echo "No APIDOC_TOKEN available. Skipping."
@ -40,11 +40,11 @@ cd build/apidoc
# This will re-use already existing branches (updated PR). # This will re-use already existing branches (updated PR).
if [ "$PR_NUMBER" != "" ]; then if [ "$PR_NUMBER" != "" ]; then
BRANCH="pr-$PR_NUMBER" BRANCH="pr-$PR_NUMBER"
elif ["$GITHUB_HEAD_REF" != "" ] && [ "$GITHUB_HEAD_REF" != master ]; then elif [ "$GITHUB_REF" != "" ] && [ "$GITHUB_REF" != "refs/heads/master" ]; then
# Use merge-base of master in branch name, to keep different branches with # Use merge-base of master in branch name, to keep different branches with
# the same name apart. # the same name apart.
# shellcheck disable=SC2015 # shellcheck disable=SC2015
BRANCH="$GITHUB_HEAD_REF-$(cd "$REPO_DIR" \ BRANCH="$GITHUB_REF-$(cd "$REPO_DIR" \
&& git fetch --unshallow origin master \ && git fetch --unshallow origin master \
&& git rev-parse --short "$(git merge-base HEAD FETCH_HEAD || true)" || true)" && git rev-parse --short "$(git merge-base HEAD FETCH_HEAD || true)" || true)"
else else
@ -91,7 +91,7 @@ COMMIT_MSG="Update docs for $AWESOME_VERSION via Github Actions
Last commit message: Last commit message:
$LAST_COMMIT_MSG $LAST_COMMIT_MSG
Commits: https://github.com/awesomeWM/awesome/compare/${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} Commits: $GITHUB_COMPARE
Build URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" Build URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
git commit -m "[relevant] $COMMIT_MSG" git commit -m "[relevant] $COMMIT_MSG"

View File

@ -151,6 +151,7 @@ jobs:
env: env:
PR_NUMBER: ${{ github.event.number }} PR_NUMBER: ${{ github.event.number }}
APIDOC_TOKEN: ${{ secrets.AWESOME_ROBOT_TOKEN || github.token }} APIDOC_TOKEN: ${{ secrets.AWESOME_ROBOT_TOKEN || github.token }}
GITHUB_COMPARE: ${{ github.event.compare }}
run: .github/scripts/apidoc.sh run: .github/scripts/apidoc.sh
# vim: filetype=yaml:expandtab:shiftwidth=2:tabstop=2 # vim: filetype=yaml:expandtab:shiftwidth=2:tabstop=2