mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
ci: handle edgecases
This commit is contained in:
@@ -26,7 +26,8 @@ jobs:
|
|||||||
- name: Restore @main refs
|
- name: Restore @main refs
|
||||||
run: |
|
run: |
|
||||||
sed -i "s|uses: graycoreio/github-actions-magento2/\([^@]*\)@[^ #]*|uses: graycoreio/github-actions-magento2/\1@main|g" \
|
sed -i "s|uses: graycoreio/github-actions-magento2/\([^@]*\)@[^ #]*|uses: graycoreio/github-actions-magento2/\1@main|g" \
|
||||||
*/action.yml .github/workflows/*.yml .github/workflows/*.yaml
|
*/action.yml \
|
||||||
|
$(find .github/workflows \( -name "*.yml" -o -name "*.yaml" \) ! -name "release-pinback.yml")
|
||||||
|
|
||||||
- name: Show changed files
|
- name: Show changed files
|
||||||
run: git diff
|
run: git diff
|
||||||
@@ -54,15 +55,21 @@ jobs:
|
|||||||
git checkout -b chore/pinback-${{ steps.version.outputs.VERSION }}
|
git checkout -b chore/pinback-${{ steps.version.outputs.VERSION }}
|
||||||
git add .
|
git add .
|
||||||
git commit -m "chore: restore internal action refs to @main"
|
git commit -m "chore: restore internal action refs to @main"
|
||||||
git push origin chore/pinback-${{ steps.version.outputs.VERSION }}
|
git push --force origin chore/pinback-${{ steps.version.outputs.VERSION }}
|
||||||
|
|
||||||
- name: Open PR
|
- name: Open PR
|
||||||
if: ${{ steps.local-changes.outputs.HAS_LOCAL_CHANGES == 'true' }}
|
if: ${{ steps.local-changes.outputs.HAS_LOCAL_CHANGES == 'true' }}
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GRAYBOT_PIN_BACK_PAT }}
|
GH_TOKEN: ${{ secrets.GRAYBOT_PIN_BACK_PAT }}
|
||||||
run: |
|
run: |
|
||||||
gh pr create \
|
BRANCH="chore/pinback-${{ steps.version.outputs.VERSION }}"
|
||||||
--base main \
|
EXISTING=$(gh pr list --head "$BRANCH" --json number --jq '.[0].number // empty')
|
||||||
--head chore/pinback-${{ steps.version.outputs.VERSION }} \
|
if [ -z "$EXISTING" ]; then
|
||||||
--title "chore: restore internal action refs to @main after ${{ steps.version.outputs.VERSION }}" \
|
gh pr create \
|
||||||
--body "Restores all internal \`graycoreio/github-actions-magento2\` action refs from \`${{ steps.version.outputs.VERSION }}\` back to \`@main\`."
|
--base main \
|
||||||
|
--head "$BRANCH" \
|
||||||
|
--title "chore: restore internal action refs to @main after ${{ steps.version.outputs.VERSION }}" \
|
||||||
|
--body "Restores all internal \`graycoreio/github-actions-magento2\` action refs from \`${{ steps.version.outputs.VERSION }}\` back to \`@main\`."
|
||||||
|
else
|
||||||
|
echo "PR #$EXISTING already exists for $BRANCH — skipping creation"
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user