diff --git a/.github/workflows/_issue_comment.yaml b/.github/workflows/_issue_comment.yaml new file mode 100644 index 0000000..bec9f25 --- /dev/null +++ b/.github/workflows/_issue_comment.yaml @@ -0,0 +1,12 @@ +name: Handle Issue Comment + +on: + issue_comment: + +jobs: + reconcile-issue-comment: + permissions: + contents: write + issues: write + pull-requests: write + uses: ./.github/workflows/reconcile-issue-comment.yaml diff --git a/.github/workflows/_issues.yaml b/.github/workflows/_issues.yaml new file mode 100644 index 0000000..f1437cd --- /dev/null +++ b/.github/workflows/_issues.yaml @@ -0,0 +1,25 @@ +name: Reconcile GitHub Issue + +on: + issues: + types: + - opened + - edited + - closed + - reopened + - labeled + - unlabeled + +# This prevents potential race conditions by only allowing this action to handle +# one update at a time for a given issue. +concurrency: + group: reconcile-issue-${{ github.event.issue.number }} + cancel-in-progress: true + +jobs: + reconcile-issue: + permissions: + contents: write + issues: write + pull-requests: write + uses: ./.github/workflows/reconcile-issue.yaml diff --git a/.github/workflows/reconcile-issue-comment.yaml b/.github/workflows/reconcile-issue-comment.yaml new file mode 100644 index 0000000..b6252fc --- /dev/null +++ b/.github/workflows/reconcile-issue-comment.yaml @@ -0,0 +1,116 @@ +name: Reusable Reconcile Issue Comment + +on: + workflow_call: + +jobs: + event_type: + name: Check event type + runs-on: ubuntu-latest + if: > + github.event_name == 'issue_comment' && + ( + github.event.action == 'created' || + github.event.action == 'edited' + ) + steps: + - name: ok + run: /bin/true + + addLabels: + needs: event_type + name: Add Labels + runs-on: ubuntu-latest + steps: + - name: ok + uses: actions/github-script@v7 + with: + script: | + const commentRegex = /()|()|(