diff --git a/.github/actions/common/action.yml b/.github/actions/common/action.yml new file mode 100644 index 000000000..49859c327 --- /dev/null +++ b/.github/actions/common/action.yml @@ -0,0 +1,21 @@ +name: "Common Workflow" + +runs: + using: "composite" + steps: + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + cache: true + + - name: Fetch Flutter Dependencies + shell: bash + run: flutter pub get + + - name: Validate Code Format + shell: bash + run: dart format --output=none --set-exit-if-changed . + + - name: Analyze Code + shell: bash + run: flutter analyze \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index cb1395401..862f62226 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -13,25 +13,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - cache: true - - - name: Fetch Flutter Dependencies - run: flutter pub get - - - name: Validate Code Format - run: dart format --output=none --set-exit-if-changed . - - - name: Analyze Code - run: flutter analyze + - uses: ./.github/actions/common - name: Hydrate and Update Version id: flutter-version run: | - git config --global user.name "${{ github.workflow }}" - git config --global user.email "gh-actions@${{ github.repository_owner }}" + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git clone --branch=version https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} version cd version @@ -136,8 +124,8 @@ jobs: - name: Upload APK/AAB to apk branch if: ${{ github.repository == 'fossasia/badgemagic-android' }} run: | - git config --global user.name "${{ github.workflow }}" - git config --global user.email "gh-actions@${{ github.repository_owner }}" + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk cd apk