Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <jacob.woffenden@digital.justice.gov.uk>
  • Loading branch information
Jacob Woffenden committed Jan 18, 2024
1 parent 8fd1fe8 commit 3cd2a5f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
name: Add Issue to Epic
---
name: Add issue to epic

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

concurrency:
group: add-issue-to-epic
cancel-in-progress: false

permissions: read-all

jobs:
update_epic_description:
add-issue-to-epic:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Amend Epic Description with New Item
uses: actions/github-script@v7.0.1
- name: Add issue to Epic
id: add_issue_to_epic
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log("Starting script...");
const payload = context.payload;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
name: Create Epic Label
---
name: Create epic label

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

# Ensure the workflow runs only once at a time
concurrency:
group: create-epic-label
cancel-in-progress: true

permissions: read-all

jobs:
create_epic_label:
runs-on: ubuntu-latest
create-epic-label:
if: github.event.label.name == 'Epic'
name: Create epic label
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Check if Epic and Create Label
uses: actions/github-script@v7.0.1
- name: Create epic label
id: create_epic_label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueTitle = context.payload.issue.title;
const issueNumber = context.payload.issue.number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
name: Remove Issue from Epic Description
---
name: Remove issue from epic

on:
on: # yamllint disable-line rule:truthy
issues:
types: [unlabeled]
types:
- unlabeled

concurrency:
group: remove-issue-from-epic
cancel-in-progress: false

permissions: read-all

jobs:
remove_from_epic_description:
remove-issue-from-epic:
name: Remove Issue from epic
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Remove Issue Link from Epic Description
uses: actions/github-script@v7.0.1
- name: Remove issue from epic
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const payload = context.payload;
const issueNumber = payload.issue.number;
Expand Down

0 comments on commit 3cd2a5f

Please sign in to comment.