Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update push.yml to Auto-Commit Changes in pubspec.lock #2701

Open
wants to merge 8 commits into
base: develop-postgres
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# NOTE!
#
# Please read the README.md file in this directory that defines what should
# Please read the README.md file in this directory that defines what should
# be placed in this file
#
##############################################################################
Expand All @@ -19,21 +19,24 @@ on:
- "*"

env:
CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}

jobs:
CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}

jobs:

Flutter-Codebase-Check:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Checking Codebase
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
# This is important to fetch all history for all branches and tags.
# This could be important for our documentation generation process.
# See: https://github.com/actions/checkout
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
Expand All @@ -46,6 +49,18 @@ jobs:
run: cd talawa_lint && flutter pub get && cd ..
- name: Running pub get to fetch dependencies
run: flutter pub get
- name: Check and commit pubspec.lock changes
run: |
if [[ $(git status --porcelain pubspec.lock) ]]; then
echo "Changes detected in pubspec.lock. Auto-committing updates."
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pubspec.lock
git commit -m "Automated update of pubspec.lock"
git push
else
echo "No changes in pubspec.lock."
fi
- name: Checking for correct formatting of code
run: dart format --set-exit-if-changed .
- name: setup python
Expand All @@ -65,10 +80,10 @@ jobs:
run: flutter analyze --no-pub
- name: Analysing codebase for custom linting
run: dart run custom_lint
# - name: Echo the GitHub environment for troubleshooting
# run: echo "$GITHUB_CONTEXT"
# - name: Echo the GitHub context for troubleshooting
# run: echo "${{ toJSON(github) }}"
# - name: Echo the GitHub environment for troubleshooting
# run: echo "$GITHUB_CONTEXT"
# - name: Echo the GitHub context for troubleshooting
# run: echo "${{ toJSON(github) }}"


Flutter-Testing:
Expand All @@ -82,7 +97,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17.0'
java-version: '17.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.3'
Expand All @@ -99,7 +114,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: false
name: '${{env.CODECOV_UNIQUE_NAME}}'
name: '${{env.CODECOV_UNIQUE_NAME}}'

Android-Build-and-Release:
if: ${{ github.actor != 'dependabot[bot]' }}
Expand All @@ -114,7 +129,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17.0'
java-version: '17.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.3'
Expand Down Expand Up @@ -161,7 +176,7 @@ jobs:
########################################################
## Package the app as an .ipa and create a release ##
########################################################

- name: Releasing for iOS
run: |
mkdir Payload
Expand Down
Loading