-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 2.67 KB
/
test-action.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
56
57
58
59
60
61
62
63
name: Test action
on:
workflow_dispatch:
concurrency: ${{ github.workflow }}
jobs:
branch:
runs-on: ubuntu-latest
steps:
- uses: actions4git/setup-git@v1
- run: git clone "https://x:$TOKEN@github.com/actions4git/add-commit-push-test.git" .
env:
TOKEN: ${{ secrets.ADD_COMMIT_PUSH_TEST_TOKEN }}
- run: echo '{"sha":"${{ github.sha }}"}' > branch.json
- run: git add --all
- run: git commit --message 'Trigger branch'
- run: git push --force
- run: echo 'https://github.com/actions4git/add-commit-push-test/actions/workflows/test-branch.yml' >> "$GITHUB_STEP_SUMMARY"
- run: sleep 10s
tag:
needs: branch
runs-on: ubuntu-latest
steps:
- uses: actions4git/setup-git@v1
- run: git clone "https://x:$TOKEN@github.com/actions4git/add-commit-push-test.git" .
env:
TOKEN: ${{ secrets.ADD_COMMIT_PUSH_TEST_TOKEN }}
- run: echo '{"sha":"${{ github.sha }}"}' > tag.json
- run: git add --all
- run: git commit --message 'Trigger tag'
- run: git tag --force v0.0.0
- run: git push --force origin v0.0.0
- run: echo 'https://github.com/actions4git/add-commit-push-test/actions/workflows/test-tag.yml' >> "$GITHUB_STEP_SUMMARY"
- run: sleep 10s
pull-request:
needs: tag
runs-on: ubuntu-latest
steps:
- uses: actions4git/setup-git@v1
- run: git clone "https://x:$TOKEN@github.com/actions4git/add-commit-push-test.git" .
env:
TOKEN: ${{ secrets.ADD_COMMIT_PUSH_TEST_TOKEN }}
- run: echo '{"sha":"${{ github.sha }}"}' > pull-request.json
- run: git add --all
- run: git commit --message 'Trigger pull-request'
- run: git push --force origin main:pull-request
- run: echo 'https://github.com/actions4git/add-commit-push-test/actions/workflows/test-pull-request.yml' >> "$GITHUB_STEP_SUMMARY"
- run: sleep 10s
pull-request-fork:
needs: pull-request
runs-on: ubuntu-latest
steps:
- uses: actions4git/setup-git@v1
- run: git clone "https://x:$TOKEN@github.com/actions4git/add-commit-push-test.git" .
env:
TOKEN: ${{ secrets.ADD_COMMIT_PUSH_TEST_TOKEN }}
- run: echo '{"sha":"${{ github.sha }}"}' > pull-request-fork.json
- run: git add --all
- run: git commit --message 'Trigger pull-request-fork'
- run: git push --force "https://x:$TOKEN@github.com/actions4git/add-commit-push-test-pull-request-fork.git" main
env:
TOKEN: ${{ secrets.ADD_COMMIT_PUSH_TEST_TOKEN }}
- run: echo 'https://github.com/actions4git/add-commit-push-test/actions/workflows/test-pull-request-fork.yml' >> "$GITHUB_STEP_SUMMARY"
- run: sleep 10s