mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-24 08:18:52 -03:00
improve error handling, save branch name for push
This commit is contained in:
parent
e86c6b862f
commit
3fae59fb31
16
.github/workflows/sync-linguist.yml
vendored
16
.github/workflows/sync-linguist.yml
vendored
@ -8,7 +8,13 @@ jobs:
|
|||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Create a branch
|
- name: Create a branch
|
||||||
run: git checkout -b feature/sync-linguist-$(date +%s)
|
id: branch
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
branch_name=$(feature/sync-linguist-$(date +%s))
|
||||||
|
git checkout -b $branch_name
|
||||||
|
echo "::set-output name=branch_name::$branch_name"
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
repository: github/linguist
|
repository: github/linguist
|
||||||
@ -19,7 +25,8 @@ jobs:
|
|||||||
# the `grep -v "-"` is to exclude any pre-release versions.
|
# the `grep -v "-"` is to exclude any pre-release versions.
|
||||||
# Linguist doesn't have any right now, but just in case.
|
# Linguist doesn't have any right now, but just in case.
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
cd .linguist
|
cd .linguist
|
||||||
latest=$(git tag --list | \
|
latest=$(git tag --list | \
|
||||||
grep -v "-" | \
|
grep -v "-" | \
|
||||||
@ -33,13 +40,14 @@ jobs:
|
|||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
id: commit
|
id: commit
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
if [[ -n "$(git status --porcelain)" ]]; then
|
if [[ -n "$(git status --porcelain)" ]]; then
|
||||||
git config user.name github-actions
|
git config user.name github-actions
|
||||||
git config user.email github-actions@github.com
|
git config user.email github-actions@github.com
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Updated Linguist to ${{ steps.linguist-release.outputs.linguist_version }}"
|
git commit -m "Updated Linguist to ${{ steps.linguist-release.outputs.linguist_version }}"
|
||||||
git push
|
git push --set-upstream origin ${{ steps.branch.outputs.branch_name }}
|
||||||
echo "::set-output name=needs_pr::true"
|
echo "::set-output name=needs_pr::true"
|
||||||
else
|
else
|
||||||
echo "::set-output name=needs_pr::false"
|
echo "::set-output name=needs_pr::false"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user