Skip to content

Commit

Permalink
Get ISSUE_ID as a workflow input instead of hardcoding
Browse files Browse the repository at this point in the history
TBD: update instructions for use in event-guides/how-to-run-a-raffle.md
  • Loading branch information
peckjon authored Feb 13, 2025
1 parent 95ed6ca commit f181f6b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/cicd-pages.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Deploy to Pages

# Update the issue number below to correspond to the currently active draw
env:
ISSUE_ID: 68

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Runs on new issue comments
issue_comment:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
ISSUE_ID:
description: 'Issue ID'
required: true

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Output Issue ID
run: echo ${{ env.ISSUE_ID }}
run: echo ${{ github.event.inputs.ISSUE_ID }}
- name: Setup Pages
uses: actions/configure-pages@v1
- name: Set up node with nvm
Expand All @@ -49,9 +49,8 @@ jobs:
with:
script: |
const fs = require('fs')
await github.paginate(github.rest.issues.listComments,
{ owner: 'gh-event-demos', repo: 'random-name-picker', issue_number: ${{ env.ISSUE_ID }} },
{ owner: 'gh-event-demos', repo: 'random-name-picker', issue_number: ${{ github.event.inputs.ISSUE_ID }} },
(response) => response.data.map((issuecomment) => issuecomment.user.login)
)
.then((commenters) => {
Expand Down

0 comments on commit f181f6b

Please sign in to comment.