Closed echelon closed 1 year ago
Thanks for reporting it. I'll revert the change.
@echelon Could you please share the checkout part of the action to set up a test case and analyze the issue further?
Thanks, @ZPascal !
Here's the entire contents of our action:
# This action syncs "staging" with "master" by force pushing every time it is run,
# automating our frontend staging deploys
# Adapted from:
# https://github.community/t/user-github-pages-site-auto-deploy-from-another-branch-on-push/17912/2
on:
push:
branches:
- master
jobs:
sync_staging_branch:
runs-on: [ubuntu-latest]
steps:
- name: checkout master branch
uses: actions/checkout@v2
with:
persist-credentials: false
- name: sync master to staging
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout -b staging
- name: push changes
#uses: ad-m/github-push-action@master
uses: ad-m/github-push-action@0fafdd62b84042d49ec0cb92d9cac7f7ce4ec79e
with:
# NB(echelon): Unfortunately Github does not allow the default access token
# to push to protected branches. Using a PAT with permissions can bypass this,
# but it triggers recursive Github Actions calls on branch updates (which the
# default access token does not). Ultimately, it's better to leave the staging branch
# unprotected. It gives engineers access to force push themselves.
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: staging
force: true
Thanks, @echelon, for sharing it. I'll test your settings on my test environment.
@echelon I've developed a solution and opened a new PR for the case. Can we close this issue?
Thank you so much, @ZPascal !
We use
ad-m/github-push-action@master
instead of a pinned version in our github actions.As of 75ba9fb1cfcb33ef7c6226cfdcbbef9f398a7de3 landing, the following action fails for us:
With error message:
We do not use password authentication in our actions.
Changing our actions to use
uses: ad-m/github-push-action@0fafdd62b84042d49ec0cb92d9cac7f7ce4ec79e
fixes the problem.