-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (43 loc) · 1.68 KB
/
github-extract-support.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
check-commits:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Retrieve commits for release
id: commits
run: |
previous_tag=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))
echo "::set-output name=commits::$(git log --pretty=format:'%h' --abbrev-commit ${previous_tag}..${{ github.event.release.tag_name }})"
- name: Generate token for Camunda GitHub org
id: generate-camunda-github-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
repository: marcosgvieira/agile
- name: Get correlated issues
id: issues
uses: octokit/[email protected]
with:
GITHUB_TOKEN: ${{ steps.generate-camunda-github-token.outputs.token }}
route: GET /repos/${{ github.repository }}/issues
headers: |
authorization: token ${{ steps.generate-camunda-github-token.outputs.token }}
query: |
q=sha:(${{ steps.commits.outputs.commits }})
- name: Search for SEC-123
id: search
run: |
pattern="SEC-123"
matches=$(echo "${{ steps.issues.outputs.data }}" | jq -r '.[] | select(.body | contains($pattern)) | .html_url')
if [[ -n "$matches" ]]; then
echo "::set-output name=found::true"
else
echo "::set-output name=found::false"
fi