File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Update dotnet-install script"
2+ on :
3+ workflow_dispatch :
4+ schedule :
5+ - cron : ' 0 0 * * 0' # Runs every Sunday at midnight UTC (adjust as needed)
6+
7+ jobs :
8+ fetch-latest-dotnet-install :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v3
12+
13+ - name : Run fetch-latest-dotnet-install.sh
14+ run : src/dotnet/scripts/fetch-latest-dotnet-install.sh
15+
16+ - name : Create a PR for dotnet-install.sh
17+ id : push_image_info
18+ env :
19+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20+ run : |
21+ set -e
22+ echo "Start."
23+
24+ # Configure git and Push updates
25+ git config --global user.email github-actions@github.com
26+ git config --global user.name github-actions
27+ git config pull.rebase false
28+
29+ branch=automated-script-update-$GITHUB_RUN_ID
30+ git checkout -b $branch
31+ message='Automated dotnet-install script update'
32+
33+ # Add / update and commit
34+ git add src/dotnet/scripts/vendor/dotnet-install.sh
35+ git commit -m 'Automated dotnet-install script update [skip ci]' || export NO_UPDATES=true
36+
37+ # Push
38+ if [ "$NO_UPDATES" != "true" ] ; then
39+ git push origin "$branch"
40+ gh api \
41+ --method POST \
42+ -H "Accept: application/vnd.github+json" \
43+ /repos/${GITHUB_REPOSITORY}/pulls \
44+ -f title="$message" \
45+ -f body="$message" \
46+ -f head="$branch" \
47+ -f base="$GITHUB_REF_NAME"
48+ fi
You can’t perform that action at this time.
0 commit comments