Skip to content

Commit

Permalink
Update gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed Nov 4, 2023
1 parent 01a6b15 commit 495488a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/assign_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: "assign project"

on:
issues:
types: [opened]
types:
- opened

jobs:
assign-project:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- develop
- feature/*
tags:
- v*

Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/lint_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "lint pr"

on:
pull_request:
types:
- opened

jobs:

lint:
runs-on: ubuntu-latest
steps:

- name: Check linked issue
id: linked-issues
uses: nearform-actions/[email protected]
continue-on-error: true
with:
comment: ""

- name: Check mentioned issue
id: mentioned-issues
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pattern1 = new RegExp(
"(^|\s)(#|gh-|roc-streaming/[\w-]+#)\d+($|\s)", "i");
const pattern2 = new RegExp(
"(^|\s)https?://github.com/roc-streaming/[\w-]+/issues/\d+($|\s)", "i");
const body = context.payload.pull_request.body;
return pattern1.test(body) || pattern2.test(body);
- name: Post Comment
if: |
steps.linked-issues.outputs.linked_issues_count == 0 &&
steps.mentioned-issues.outputs.result == false
uses: actions/github-script@v6
with:
script: |
github.issues.createComment({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
issue_number: github.context.payload.pull_request.number,
body: 'Test comment.'
})

0 comments on commit 495488a

Please sign in to comment.