-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (41 loc) · 1.5 KB
/
create_issue.yml
File metadata and controls
46 lines (41 loc) · 1.5 KB
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
name: Create Issue
on:
push:
# Intentionally ignore pushes so we're not generating a random file and issue every time we push
# Comment this out if you want to run the jobs below
branches-ignore:
- '**'
# Specify environment variables that will be set on all jobs
env:
WF_ENV: Available to all jobs
jobs:
create-issue:
runs-on: ubuntu-latest
steps:
- name: Push a random file
run: |
pwd
ls -a
git init
git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git"
git config --global user.email "my-bot@bot.com"
git config --global user.name "my-bot"
git fetch
git checkout master
git branch --set-upstream-to=origin/master
git pull
ls -a
echo $RANDOM >> random.txt
git add -A
git commit -m "Random file"
git push
- name: Create issue using REST API
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"title": "Automated issue for commit: ${{ github.sha }}",
"body": "This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n The commit hash was: _${{ github.sha }}_."
}'