Skip to content

Commit

Permalink
513 move issue comment workflow to its own workflow and modify confer…
Browse files Browse the repository at this point in the history
…nce builder to run only when conference approved label is added (#514)

* add auto respond

* add if conditional
  • Loading branch information
kjaymiller authored Oct 6, 2024
1 parent 72b952b commit 3806d8d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 40 deletions.
42 changes: 2 additions & 40 deletions .github/workflows/conference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event.action == 'opened' && startsWith(github.event.issue.title, '[CONFERENCE]') && contains(github.event.issue.labels.*.name, 'conference_accepted') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -51,44 +52,5 @@ jobs:
delete-branch: true
title: "[CONFERENCE] Update Conferences"
labels: |
report
automated pr
add_comment:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ env.GITHUB_TOKEN }}

- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Install dependencies
run: pip install -r requirements-dev.txt

- name: Run script
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
run: |
python _conferences
pre-commit run --all-files --show-diff-on-failure
- name: Add comment to the issue
uses: actions/github-script@v6
if: ${{ github.event.action == 'opened' && startsWith(github.event.issue.title, '[CONFERENCE]') && contains(github.event.issue.labels.*.name, 'conference') }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueNumber = context.payload.issue.number;
const comment = "Automated issue, no action is required.";
await github.issues.createComment({
...context.repo,
issue_number: issueNumber,
body: comment
});
conference
45 changes: 45 additions & 0 deletions .github/workflows/conference_auto_respond.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Conference AutoResponder

on:
issues:
types: [opened]

permissions:
issues: write

jobs:
add_comment:
runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Add initial comment to the issue
uses: actions/github-script@v6
if: ${{ github.event.action == 'opened' && startsWith(github.event.issue.title, '[CONFERENCE]') && contains(github.event.issue.labels.*.name, 'conference') }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueNumber = context.payload.issue.number;
const comment = "Thank you for submitting this issue. A member of the triage team will review the information and followup on this request. There is no code action to be taken.";
await github.issues.createComment({
...context.repo,
issue_number: issueNumber,
body: comment
});
- name: Add approved comment
uses: actions/github-script@v6
if: ${{ github.event.action == 'opened' && startsWith(github.event.issue.title, '[CONFERENCE]') && contains(github.event.issue.labels.*.name, 'conference_accepted') }}
with:
script: |
const issueNumber = context.payload.issue.number;
const comment = "Your conference submission has been accepted. You will shortly see your conference on the website."
await github.issues.createComment({
...context.repo,
issue_number: issueNumber,
body: comment
});

0 comments on commit 3806d8d

Please sign in to comment.