b3f1114a68
* Add Renovate configuration file * Delete .github/workflows/update-i18n.yaml * chore(deps): pin dependencies (#1) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update codelytv/pr-size-labeler action to v1.10.3 (#2) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Delete renovate.json --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
57 lines
2.2 KiB
YAML
57 lines
2.2 KiB
YAML
name: 🔄 Update Issues on Push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- staging
|
|
- release
|
|
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
|
|
jobs:
|
|
# This runs commits to staging/release, reading the commit messages. Check `pr-auto-manager.yml`:`update-linked-issues` for PR-linked updates.
|
|
update-linked-issues:
|
|
name: 🔗 Mark Linked Issues Done on Push
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
|
|
steps:
|
|
- name: Mint App Token
|
|
id: app
|
|
# Create a GitHub App token
|
|
# https://github.com/marketplace/actions/create-github-app-token
|
|
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
|
|
with:
|
|
app-id: ${{ vars.ST_BOT_APP_ID }}
|
|
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
|
|
owner: ${{ github.repository_owner }}
|
|
|
|
- name: Checkout Repository
|
|
# Checkout
|
|
# https://github.com/marketplace/actions/checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Extract Linked Issues from Commit Message
|
|
id: extract_issues
|
|
run: |
|
|
ISSUES=$(git log ${{ github.event.before }}..${{ github.event.after }} --pretty=%B | grep -oiE '(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) #([0-9]+)' | awk '{print $2}' | tr -d '#' | jq -R -s -c 'split("\n")[:-1]')
|
|
echo "issues=$ISSUES" >> $GITHUB_ENV
|
|
|
|
- name: Label Linked Issues
|
|
id: label_linked_issues
|
|
env:
|
|
GH_TOKEN: ${{ steps.app.outputs.token }}
|
|
run: |
|
|
for ISSUE in $(echo $issues | jq -r '.[]'); do
|
|
if [ "${{ github.ref }}" == "refs/heads/staging" ]; then
|
|
LABEL="✅ Done (staging)"
|
|
gh issue edit $ISSUE -R ${{ github.repository }} --add-label "$LABEL" --remove-label "🧑💻 In Progress"
|
|
elif [ "${{ github.ref }}" == "refs/heads/release" ]; then
|
|
LABEL="✅ Done"
|
|
gh issue edit $ISSUE -R ${{ github.repository }} --add-label "$LABEL" --remove-label "🧑💻 In Progress"
|
|
fi
|
|
echo "Added label '$LABEL' (and removed '🧑💻 In Progress' if present) in issue #$ISSUE"
|
|
done
|