Skip to content

Commit

Permalink
Merge pull request #495 from GSA/auto-add-issues
Browse files Browse the repository at this point in the history
Add new issues to GSA Project Board
  • Loading branch information
nickumia-reisys authored Oct 18, 2022
2 parents 7993ce5 + 21fa2b7 commit c08abf6
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/deploy-failure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Deployment Failure
labels: bug
---

Workflow with Issue: {{ workflow }}
Job Failed: {{ env.GITHUB_JOB }}
Last Commit: {{ env.LAST_COMMIT }}
Number of times run: {{ env.GITHUB_ATTEMPTS }}
Last run by: {{ env.LAST_RUN_BY }}
Github Action Run: https://github.com/GSA/inventory-app/actions/runs/{{ env.RUN_ID }}
11 changes: 11 additions & 0 deletions .github/restart-failure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Restart Failure
labels: bug
---

Workflow with Issue: {{ workflow }}
Job Failed: {{ env.GITHUB_JOB }}
Last Commit: {{ env.LAST_COMMIT }}
Number of times run: {{ env.GITHUB_ATTEMPTS }}
Last run by: {{ env.LAST_RUN_BY }}
Most Recent Failure: https://github.com/GSA/inventory-app/actions/runs/{{ env.RUN_ID }}
16 changes: 16 additions & 0 deletions .github/workflows/add_to_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Add New Issues to GH Projects

on: # yamllint disable-line rule:truthy
issues:
types: [opened, labeled]

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: 'https://github.com/orgs/GSA/projects/11/views/1'
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
43 changes: 42 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ jobs:
name: python-vendored
path: vendor/
if-no-files-found: error
- name: Create Issue if it fails 😢
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
GITHUB_JOB: ${{ toJson(github)['job'] }}
GITHUB_ATTEMPTS: ${{ github.run_attempt }}
LAST_COMMIT: ${{ github.sha }}
LAST_RUN_BY: ${{ github.actor }}
RUN_ID: ${{ github.run_id }}
with:
filename: .github/deploy_failure.md
assignees: ${{ github.actor }}
update_existing: true

create-cloudgov-services-staging:
name: create services (staging)
Expand Down Expand Up @@ -72,6 +86,20 @@ jobs:
cf_password: ${{secrets.CF_SERVICE_AUTH}}
- name: smoke test
run: bin/smoke.sh
- name: Create Issue if it fails 😢
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
GITHUB_JOB: ${{ toJson(github)['job'] }}
GITHUB_ATTEMPTS: ${{ github.run_attempt }}
LAST_COMMIT: ${{ github.sha }}
LAST_RUN_BY: ${{ github.actor }}
RUN_ID: ${{ github.run_id }}
with:
filename: .github/deploy_failure.md
assignees: ${{ github.actor }}
update_existing: true

create-cloudgov-services-production:
name: create services (production)
Expand Down Expand Up @@ -128,4 +156,17 @@ jobs:
cf_password: ${{secrets.CF_SERVICE_AUTH}}
- name: smoke test
run: bin/smoke.sh

- name: Create Issue if it fails 😢
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
GITHUB_JOB: ${{ toJson(github)['job'] }}
GITHUB_ATTEMPTS: ${{ github.run_attempt }}
LAST_COMMIT: ${{ github.sha }}
LAST_RUN_BY: ${{ github.actor }}
RUN_ID: ${{ github.run_id }}
with:
filename: .github/deploy_failure.md
assignees: ${{ github.actor }}
update_existing: true
28 changes: 28 additions & 0 deletions .github/workflows/restart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ jobs:
cf_space: staging
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}
- name: Create Issue if it fails 😢
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
GITHUB_JOB: ${{ toJson(github)['job'] }}
GITHUB_ATTEMPTS: ${{ github.run_attempt }}
LAST_COMMIT: ${{ github.sha }}
LAST_RUN_BY: ${{ github.actor }}
RUN_ID: ${{ github.run_id }}
with:
filename: .github/restart_failure.md
assignees: ${{ github.actor }}
update_existing: true

restart-prod:
concurrency: production
Expand Down Expand Up @@ -74,3 +88,17 @@ jobs:
cf_space: prod
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}
- name: Create Issue if it fails 😢
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
GITHUB_JOB: ${{ toJson(github)['job'] }}
GITHUB_ATTEMPTS: ${{ github.run_attempt }}
LAST_COMMIT: ${{ github.sha }}
LAST_RUN_BY: ${{ github.actor }}
RUN_ID: ${{ github.run_id }}
with:
filename: .github/restart_failure.md
assignees: ${{ github.actor }}
update_existing: true

0 comments on commit c08abf6

Please sign in to comment.