1
0
mirror of synced 2026-01-08 21:02:10 -05:00

Use --head workaround for gh pr create (#53834)

This commit is contained in:
Rachael Sewell
2025-01-09 16:17:36 -08:00
committed by GitHub
parent 6d50574e91
commit d32460bf65
3 changed files with 12 additions and 5 deletions

View File

@@ -129,7 +129,8 @@ jobs:
--title "Delete orphan files ($current_daystamp)" \
--body '👋 humans. This PR was generated from docs-internal/.github/workflows/delete-orphan-translation-files.yml.
' \
--repo "${{ matrix.language_repo }}"
--repo "${{ matrix.language_repo }}" \
--head=$branch_name
echo "Merge created PR..."
retry_command gh pr merge --merge --auto --delete-branch "$branch_name"

View File

@@ -54,7 +54,11 @@ jobs:
# If nothing to commit, exit now. It's fine. No orphans.
changes=$(git diff --name-only | wc -l)
untracked=$(git status --untracked-files --short | wc -l)
if [[ $changes -eq 0 ]] && [[ $untracked -eq 0 ]]; then
filesChanged=$(git diff --name-only)
# There will always be at least one file changed:
# src/audit-logs/lib/config.json
# If the config file is the only file changed, exit.
if [[ $changes -eq 1 ]] && [[ $untracked -eq 1 ]] && [[ $filesChanged == *lib/config.json ]]; then
echo "There are no changes to commit or untracked files. Exiting..."
exit 0
fi
@@ -83,7 +87,8 @@ jobs:
If CI does not pass or other problems arise, contact #docs-engineering on slack.' \
--repo github/docs-internal \
--label audit-log-pipeline
--label audit-log-pipeline \
--head=$branchname
# can't approve your own PR, approve with Actions
unset GITHUB_TOKEN
@@ -93,7 +98,7 @@ jobs:
# Actions can't merge the PR so back to docs-bot to merge the PR
unset GITHUB_TOKEN
gh auth login --with-token <<< "${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}"
gh pr merge --auto --delete-branch
gh pr merge --auto
- uses: ./.github/actions/slack-alert
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}

View File

@@ -76,7 +76,8 @@ jobs:
If CI does not pass or other problems arise, contact #docs-engineering on Slack.' \
--repo github/docs-internal \
--label secret-scanning-pipeline,'skip FR board',ready-for-doc-review
--label secret-scanning-pipeline,'skip FR board',ready-for-doc-review \
--head=$branchname
- uses: ./.github/actions/slack-alert
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}