mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 15:00:40 +00:00
Fixed PR check (#122)
* updated stub script to work with tags * depend on step conclusion * check PR number
This commit is contained in:
parent
4288be7d57
commit
cc660de0c4
2 changed files with 10 additions and 5 deletions
2
.github/scripts/stub_iap.sh
vendored
2
.github/scripts/stub_iap.sh
vendored
|
@ -1,2 +1,2 @@
|
|||
# https://unix.stackexchange.com/questions/435708/regex-multiline-pattern-and-substitution-replacement
|
||||
perl -0777 -i -pe 's/( m3_lightmeter_iap:\n)( git:\n url: "https:\/\/github.com\/vodemn\/m3_lightmeter_iap"\n ref: main)/$1 path: iap/sg' pubspec.yaml
|
||||
perl -0777 -i -pe 's/( m3_lightmeter_iap:\n)( git:\n url: "https:\/\/github.com\/vodemn\/m3_lightmeter_iap"\n ref: v\d{1,2}.\d{1,2}.\d{1,2})/$1 path: iap/sg' pubspec.yaml
|
13
.github/workflows/pr_check.yml
vendored
13
.github/workflows/pr_check.yml
vendored
|
@ -17,18 +17,23 @@ jobs:
|
|||
runs-on: macos-11
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: 8BitJonny/gh-get-current-pr@2.2.0
|
||||
id: PR
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Connect private iap package
|
||||
uses: webfactory/ssh-agent@v0.8.0
|
||||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
||||
id: fetch-iap
|
||||
if: steps.PR.outputs.number == 'null' || github.event.pull_request.head.repo.full_name == github.repository
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.M3_LIGHTMETER_IAP_KEY }}
|
||||
|
||||
- name: Override iap package with stub
|
||||
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
|
||||
id: override-iap
|
||||
if: steps.fetch-iap.conclusion != 'success'
|
||||
run: bash ./.github/scripts/stub_iap.sh
|
||||
|
||||
- uses: subosito/flutter-action@v2
|
||||
|
@ -49,8 +54,8 @@ jobs:
|
|||
run: flutter test
|
||||
|
||||
- name: Analyze project source with stub
|
||||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
||||
if: steps.override-iap.conclusion != 'success'
|
||||
run: |
|
||||
bash ./.github/scripts/stub_iap.sh
|
||||
flutter pub get
|
||||
flutter analyze lib --fatal-infos
|
||||
flutter analyze lib --fatal-infos
|
Loading…
Reference in a new issue