Skip to content

Commit

Permalink
ci: establish snake_case convention for jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac authored and nikku committed Nov 1, 2024
1 parent fed4b3b commit 238069a
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ADD_TO_PROJECT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- labeled

jobs:
Exec:
exec:
name: Add issue to project
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ASSIGN_MILESTONE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: ['closed']

jobs:
check-permissions:
check_permissions:
runs-on: ubuntu-latest
name: Check Repo Permission
outputs:
Expand All @@ -24,13 +24,13 @@ jobs:
--jq '.permission')
echo "PERMISSION=$PERMISSION" >> $GITHUB_OUTPUT
assign-milestone:
assign_milestone:
runs-on: ubuntu-latest
name: Assign Milestone
needs: check-permissions
needs: check_permissions
if: |
needs.check-permissions.outputs.permission == 'admin' ||
needs.check-permissions.outputs.permission == 'write'
needs.check_permissions.outputs.permission == 'admin' ||
needs.check_permissions.outputs.permission == 'write'
steps:
- name: Get current Milestone
id: getMilestone
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/BUILD_ON_DEMAND.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
description: 'Dependencies to link from GitHub (format: bpmn-js#develop,dmn-js#9.0.0)'
default: ''
jobs:
Build:
build:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-2022 ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on: [ push, pull_request ]
jobs:
Build:
build:
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/CODE_SCANNING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ on:
- '**/*.md'

jobs:
CodeQL-Build:
codeql_build:
name: Scan with CodeQL

# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/COMMENT_DEVELOP_FIX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
permissions:
pull-requests: write
jobs:
comment-on-fix-to-develop:
comment:
name: Comment on fix to develop
runs-on: ubuntu-latest
steps:
- name: Check for fix commits
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CREATE_MILESTONE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: ['closed']

jobs:
create-milestone:
create_milestone:
runs-on: ubuntu-latest
name: Create new Milestone
if: startsWith(github.event.milestone.title, 'M')
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/MERGE_MAIN_TO_DEVELOP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- "main"

jobs:
Merge_main_to_develop:
merge_main_to_develop:
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -23,8 +23,9 @@ jobs:
git merge -m 'chore: merge main to develop' --no-edit origin/main
git push
Post-Failure:
needs: Merge_main_to_develop
post_failure:
name: Notify failure
needs: merge_main_to_develop
if: failure()
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/NEW_ALPHA_ISSUE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
# After the April and October releases
- cron: '0 8 15 APR,OCT *'
jobs:
createIssue:
create_issue:
name: Create issue
runs-on: ubuntu-latest
steps:
- run: gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --label "ready" --repo $GITHUB_REPOSITORY
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/NEW_MAJOR_ISSUE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
# Before the April and October releases
- cron: '0 8 15 MAR,SEP *'
jobs:
createIssue:
create_issue:
name: Create issue
runs-on: ubuntu-latest
steps:
- run: gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --label "ready" --repo $GITHUB_REPOSITORY
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/NIGHTLY.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
schedule:
- cron: '0 18 * * *'
jobs:
Build_nightly:
build_nightly:
name: Build nightly
strategy:
matrix:
include:
Expand Down Expand Up @@ -102,8 +103,9 @@ jobs:
artifact_subpath: 'nightly'
artifact_file: "${{ join(matrix.files, ' ') }}"

Post-Failure:
needs: Build_nightly
post_failure:
name: Notify failure
needs: build_nightly
if: failure()
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/PUBLISH_RELEASE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types:
- released
jobs:
Publish:
publish:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -37,8 +37,9 @@ jobs:
version: ${{ steps.retrieveVersion.outputs.version }}
artifact_file: 'artifacts/*'

Post-Failure:
needs: Publish
post_failure:
name: Notify failure
needs: publish
if: failure()
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/RELEASE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
tags:
- 'v*'
jobs:
Pre_release:
pre_release:
name: Prepare release
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -18,8 +19,9 @@ jobs:
TAG=$(git describe --tags --abbrev=0)
gh release create $TAG --draft --title $TAG
Build_release:
needs: Pre_release
build_release:
name: Build release
needs: pre_release
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-2022 ]
Expand Down Expand Up @@ -102,8 +104,9 @@ jobs:
NODE_ENV: "production"
run: npm run build -- --win --publish

Post_release:
needs: Build_release
post_release:
name: Post release
needs: build_release
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/RELEASE_ISSUE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@ on:
issues:
types: [closed, assigned]
jobs:
createReleaseIssue:
create_release_issue:
runs-on: ubuntu-latest
name: Create new Release Issue
if: |
contains(github.event.issue.labels.*.name, 'release') &&
github.event.action == 'closed'
outputs:
assignee: ${{ steps.createReleaseIssue.outputs.assignee }}
assignee: ${{ steps.create_release_issue.outputs.assignee }}
steps:
- id: createReleaseIssue
- id: create_release_issue
name: Create new Release Issue
uses: bpmn-io/actions/release-issue@latest
with:
template-path: 'docs/.project/RELEASE_TEMPLATE.md'
package-path: 'app/package.json'

assignMilestone:
needs: createReleaseIssue
assign_milestone:
name: Assign milestone
needs: create_release_issue
if: github.event.issue.milestone
runs-on: ubuntu-latest
name: Assign Milestone
Expand All @@ -45,16 +46,16 @@ jobs:
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/issues/${{ fromJson(needs.createReleaseIssue.outputs.issue).number }} \
/repos/${{ github.repository }}/issues/${{ fromJson(needs.create_release_issue.outputs.issue).number }} \
-F "milestone=${{steps.getMilestone.outputs.MILESTONE_NUMBER}}"
updateSlackRole:
update_slack_role:
name: Sync Slack roles
needs: create_release_issue
runs-on: ubuntu-latest
if: |
always() &&
contains(github.event.issue.labels.*.name, 'release')
name: Sync Slack roles
needs: createReleaseIssue
steps:
- name: Import Secrets
id: secrets
Expand All @@ -74,12 +75,13 @@ jobs:
SLACK_BOT_TOKEN: ${{ steps.secrets.outputs.SLACK_BOT_TOKEN }}
GROUP_ID: ${{ steps.secrets.outputs.RELEASE_MANAGER_GROUP_ID }}
# User ID is either the assignee from the newly created issue or the new assigned from the `assigned` trigger
USER_ID: ${{ fromJSON(steps.secrets.outputs.TEAM_MEMBER_IDS)[ needs.createReleaseIssue.outputs.assignee || github.event.issue.assignee.login ] }}
USER_ID: ${{ fromJSON(steps.secrets.outputs.TEAM_MEMBER_IDS)[ needs.create_release_issue.outputs.assignee || github.event.issue.assignee.login ] }}
run: |
curl --fail-with-body -X POST -H "application/x-www-form-urlencoded" -d "token=${SLACK_BOT_TOKEN}&usergroup=${GROUP_ID}&users=${USER_ID}" https://slack.com/api/usergroups.users.update
notifyOnSlack:
needs: createReleaseIssue
notify_on_slack:
name: Notify new release manager on Slack
needs: create_release_issue
if: |
always() &&
contains(github.event.issue.labels.*.name, 'release')
Expand All @@ -105,5 +107,5 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ steps.secrets.outputs.SLACK_BOT_TOKEN }}
# Release manager is either the assignee from the newly created issue or the new assigned from the `assigned` trigger
RELEASE_MANAGER: ${{ needs.createReleaseIssue.outputs.assignee || github.event.issue.assignee.login }}
ISSUE_LINK: https://github.com/${{ github.repository }}/issues/${{ fromJson(needs.createReleaseIssue.outputs.issue).number }}
RELEASE_MANAGER: ${{ needs.create_release_issue.outputs.assignee || github.event.issue.assignee.login }}
ISSUE_LINK: https://github.com/${{ github.repository }}/issues/${{ fromJson(needs.create_release_issue.outputs.issue).number }}

0 comments on commit 238069a

Please sign in to comment.