github_action: fix crash on pr;and update policy to be triggered by all branch
This commit is contained in:
parent
7d49e14c13
commit
3d9bca5f12
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@ -4,8 +4,6 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "README.md"
|
||||
@ -32,6 +30,7 @@ jobs:
|
||||
branch_name: ${{ env.branch_name }}
|
||||
tag_name: ${{ env.tag_name }}
|
||||
push_type: ${{ env.push_type }}
|
||||
is_pr: ${{ env.is_pr }}
|
||||
|
||||
steps:
|
||||
- name: Determine push type
|
||||
@ -45,6 +44,8 @@ jobs:
|
||||
echo "branch_name=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "push_type=branch" >> $GITHUB_ENV
|
||||
fi
|
||||
is_pr=$([[ "${{ github.event_name }}" == "pull_request" ]] && echo 1 || echo 0)
|
||||
echo "is_pr=${is_pr}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout
|
||||
if:
|
||||
@ -59,7 +60,7 @@ jobs:
|
||||
python3 ./scripts/update_support_list.py temp_support_list ./luci/luci-app-qmodem/root/usr/share/qmodem/modem_support.json
|
||||
is_diff=$(diff ./temp_support_list.md ./docs/support_list.md > /dev/null 2>&1 && echo 0 || echo 1)
|
||||
echo "is_diff=${is_diff}" >> $GITHUB_ENV
|
||||
if [[ ${is_diff} == 1 ]]; then
|
||||
if [[ ${is_pr} == 0 ]] && [[ ${is_diff} == 1 ]]; then
|
||||
mv temp_support_list.md ./docs/support_list.md
|
||||
git config --global user.name "GitHub Action"
|
||||
git config --global user.email "github-action@users.noreply.github.com"
|
||||
@ -172,6 +173,7 @@ jobs:
|
||||
name: Release Artifacts
|
||||
needs: [job_build_qmodem, job_prepare]
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ needs.job_prepare.outputs.push_type == 'tag' }}
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
Loading…
x
Reference in New Issue
Block a user