Skip to content

Commit

Permalink
workflows: automatically recheck for updates when issue is closed
Browse files Browse the repository at this point in the history
Detect the closure of a dependency update issue and rerun the update
check, since Meson wraps have probably been updated in wrapdb.

Signed-off-by: Benjamin Gilbert <[email protected]>
  • Loading branch information
bgilbert committed Oct 1, 2023
1 parent 40c5dda commit 87e52d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/event-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Issue event

on:
issues:
types: [opened]
types: [opened, closed]

permissions:
issues: write
Expand All @@ -16,6 +16,8 @@ jobs:
issue-event:
name: Process
runs-on: ubuntu-latest
outputs:
bot-user: ${{ steps.bot-user.outputs.username }}
steps:
- name: Get bot username
id: bot-user
Expand All @@ -24,6 +26,7 @@ jobs:
run: echo "username=$(gh api user -q .login)" >> $GITHUB_OUTPUT
- name: Label dependency issue
if: >-
github.event.action == 'opened' &&
github.actor == steps.bot-user.outputs.username &&
contains(github.event.issue.body, 'topic=dependencies')
env:
Expand All @@ -32,3 +35,12 @@ jobs:
gh issue edit -R "${{ github.repository }}" \
"${{ github.event.issue.number }}" \
--add-label $GH_LABEL
update-from-issue:
name: Check for updates
needs: issue-event
if: >-
github.event.action == 'closed' &&
github.event.issue.user.login == needs.issue-event.outputs.bot-user &&
contains(github.event.issue.body, 'topic=dependencies')
uses: ./.github/workflows/update-check.yml
secrets: inherit
4 changes: 4 additions & 0 deletions .github/workflows/update-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths: ['meson/subprojects/*.wrap']
schedule:
- cron: '0 12 * * 1'
workflow_call:
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -80,6 +81,9 @@ jobs:
$(cat stale-report)
\`\`\`
I will automatically check wrapdb for updates when this issue is \
closed.
<!-- topic=dependencies -->"
if [ -z "$issue" ]; then
echo "Creating issue..."
Expand Down

0 comments on commit 87e52d1

Please sign in to comment.