Skip to content

Commit d6966b8

Browse files
authored
Pin GitHub Actions to specific SHAs, delete unused workflows, and other tidying (#1662)
2 parents 65b771f + 3194758 commit d6966b8

10 files changed

Lines changed: 47 additions & 198 deletions

.github/dependabot.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# To get started with Dependabot version updates, you'll need to specify which
22
# package ecosystems to update and where the package manifests are located.
33
# Please see the documentation for all configuration options:
4-
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
4+
# https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference
55

66
version: 2
77
updates:
88
- package-ecosystem: "github-actions"
9-
# Workflow files stored in the
10-
# default location of `.github/workflows`
9+
# Workflow files stored in the default location of `.github/workflows`
1110
directory: "/"
1211
schedule:
1312
interval: "daily"

.github/workflows/close-crm-update.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/generate-qr-code.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate QR code
1+
name: Generate QR Code
22
on:
33
workflow_dispatch:
44
inputs:
@@ -38,10 +38,10 @@ jobs:
3838
runs-on: ubuntu-latest
3939
steps:
4040
- name: Checkout
41-
uses: actions/checkout@v7
41+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
4242

4343
- name: Setup Python
44-
uses: actions/setup-python@v6
44+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # 6.3.0
4545
with:
4646
python-version: "3.11"
4747
cache: pip
@@ -60,7 +60,7 @@ jobs:
6060
qr-code.png
6161
6262
- name: Upload QR code as artifact
63-
uses: actions/upload-artifact@v7
63+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
6464
with:
6565
name: qr-code.png
6666
path: qr-code.png

.github/workflows/mkdocs-preview.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
pull-requests: write
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v7
19+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
2020
with:
2121
ref: "refs/pull/${{ github.event.number }}/merge"
2222

2323
- name: Setup Python
24-
uses: actions/setup-python@v6
24+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # 6.3.0
2525
with:
2626
python-version: "3.10"
2727
cache: pip
@@ -46,23 +46,18 @@ jobs:
4646
--site=${{ secrets.NETLIFY_PREVIEW_APP_SITE_ID }}
4747
4848
- name: Find existing comment
49-
uses: peter-evans/find-comment@v4
49+
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # 4.0.0
5050
id: find-comment
5151
with:
5252
issue-number: ${{ github.event.number }}
5353
comment-author: "github-actions[bot]"
54-
body-includes: "Preview url: https://"
54+
body-includes: "Preview URL: https://"
5555

5656
- name: Add Netlify link PR comment
57-
uses: actions/github-script@v9
5857
if: steps.find-comment.outputs.comment-id == ''
59-
with:
60-
github-token: ${{ secrets.GITHUB_TOKEN }}
61-
script: |
62-
const hostnameSuffix = "cal-itp-previews.netlify.app"
63-
github.rest.issues.createComment({
64-
issue_number: context.issue.number,
65-
owner: context.repo.owner,
66-
repo: context.repo.repo,
67-
body: `Preview url: https://${context.repo.repo}-${{ github.event.number }}--${hostnameSuffix}`,
68-
})
58+
env:
59+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
PR_NUMBER: ${{ github.event.number }}
61+
run: |
62+
gh pr comment ${{ github.event.number }} \
63+
--body "Preview URL: https://${GITHUB_REPOSITORY#*/}-$PR_NUMBER--cal-itp-previews.netlify.app"

.github/workflows/mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v7
17+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
1818

1919
- name: Deploy docs
20-
uses: mhausenblas/mkdocs-deploy-gh-pages@master
20+
uses: mhausenblas/mkdocs-deploy-gh-pages@d77dd03172e96abbcdb081d8c948224762033653
2121
env:
2222
REQUIREMENTS: docs/requirements.txt
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create Monthly D5 update issue
1+
name: Create Monthly D5 Update Issue
22

33
on:
44
workflow_dispatch:
@@ -13,22 +13,21 @@ jobs:
1313
issues: write
1414
steps:
1515
# Get last month's name as a variable
16-
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
16+
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#setting-an-output-parameter
1717
- id: set_output
1818
run: |
1919
echo "month=$(date -d 'last month' +%B)" >> $GITHUB_OUTPUT
2020
2121
- id: create_issue
22-
uses: imjohnbo/issue-bot@v3
23-
with:
24-
assignees: "o-ram, laneymangan"
25-
labels: reporting
26-
title: Send monthly update to D5 for ${{steps.set_output.outputs.month}}
27-
body: |
28-
## To-Do
29-
30-
- [ ] Inform D5 transit reps of any updates regarding district agencies or relevant Cal-ITP news from ${{steps.set_output.outputs.month}}
31-
pinned: false
32-
close-previous: false
3322
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
# The `--body-file -` option below uses the multiline content from stdin for the body.
25+
# See: https://github.com/cli/cli/issues/595
26+
run: |
27+
echo -e "## To-Do\n\n- [ ] Inform D5 transit reps of any updates regarding district agencies or relevant Cal-ITP news from ${{ steps.set_output.outputs.month }}" | \
28+
gh issue create \
29+
--title "Send monthly update to D5 for ${{ steps.set_output.outputs.month }}" \
30+
--body-file - \
31+
--label "reporting" \
32+
--assignee o-ram,laneymangan \
33+
--repo $GITHUB_REPOSITORY

.github/workflows/monthly-report-issue.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/new-user-notify-slack.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Notify Slack for New User requests
1+
name: Notify Slack for New User Requests
22

33
on:
44
issues:
@@ -10,12 +10,12 @@ jobs:
1010
if: contains(github.event.issue.labels.*.name, 'new-user')
1111
steps:
1212
- name: Slack notification
13-
uses: rtCamp/action-slack-notify@v2
13+
uses: rtCamp/action-slack-notify@33ca3be66c6f378fe1610fd1d5258632dbed5e58
1414
env:
1515
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
1616
SLACK_USERNAME: cal-itp-bot
1717
SLACK_MSG_AUTHOR: cal-itp-bot
1818
SLACK_ICON: https://github.com/cal-itp-bot.png?size=48
19-
SLACK_MESSAGE: "A Hubspot new user request was submitted: ${{ github.event.issue.html_url }}"
19+
SLACK_MESSAGE: "A HubSpot new user request was submitted: ${{ github.event.issue.html_url }}"
2020
SLACK_FOOTER: ""
2121
MSG_MINIMAL: true

.github/workflows/notes-sync.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.
Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create Quaterly Report issue
1+
name: Create Quaterly Report Issue
22

33
on:
44
workflow_dispatch:
@@ -13,25 +13,21 @@ jobs:
1313
issues: write
1414
steps:
1515
# Get last month's name as a variable
16-
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
16+
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#setting-an-output-parameter
1717
- id: set_output
1818
run: |
1919
echo "month=$(date -d 'last month' +%B)" >> $GITHUB_OUTPUT
2020
2121
- id: create_issue
22-
uses: imjohnbo/issue-bot@v3
23-
with:
24-
assignees: j-h-sullivan
25-
labels: reporting
26-
title: Draft and send Quarterly Report for ${{steps.set_output.outputs.month}}
27-
body: |
28-
## To-Do
29-
30-
- [ ] Pull in information from Metabase and Hubspot
31-
- [ ] Draft report in Google Doc
32-
- [ ] Review from @AnthonyRollins and @o-ram
33-
- [ ] Send for design to Colleen
34-
pinned: false
35-
close-previous: false
3622
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
# The `--body-file -` option below uses the multiline content from stdin for the body.
25+
# See: https://github.com/cli/cli/issues/595
26+
run: |
27+
echo -e "## To-Do\n\n- [ ] Pull in information from Metabase and HubSpot\n- [ ] Draft report in Google Doc\n- [ ] Review from @AnthonyRollins and @o-ram\n- [ ] Send for design to Colleen" | \
28+
gh issue create \
29+
--title "Draft and send Quarterly Report for ${{ steps.set_output.outputs.month }}" \
30+
--body-file - \
31+
--label "reporting" \
32+
--assignee j-h-sullivan \
33+
--repo $GITHUB_REPOSITORY

0 commit comments

Comments
 (0)