-
Notifications
You must be signed in to change notification settings - Fork 13
36 lines (36 loc) · 1.28 KB
/
main.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
name: main
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
env:
repo: btwrk/action-jira-linter-test
branch_name: feature/dx-1905_${{ github.sha }}
GH_TOKEN: ${{ secrets.GH_JIRA_TEST_TOKEN }}
steps:
- name: checkout jira-linter-test
uses: actions/checkout@v3
with:
repository: ${{ env.repo }}
ref: main
token: ${{ env.GH_TOKEN }}
- name: configure git
run: |
git config --global user.email "jira-linter@example.com"
git config --global user.name "jira-linter"
- name: create branch
run: git checkout -b "${branch_name}"
- name: create content
run: echo "${{ github.sha }}" >> README.md
- name: commit content
run: git commit -am "Added ${{ github.sha }}"
- name: push
run: git push --set-upstream origin "${branch_name}"
- name: create pull request
run: gh pr create --title "Test for GitHub Actions" --body " "
- name: watch run
run: gh run list --repo "${repo}" --branch "${branch_name}" --json databaseId --jq .[].databaseId | while read id; do gh run watch "${id}" --exit-status --repo "${repo}"; done;
- name: cleanup
run: git push origin --delete "${branch_name}"