-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
201 changed files
with
1,680 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,24 @@ name: Update Outdated Bitrise Steps Versions | |
|
||
on: | ||
schedule: | ||
- cron: "0 3 * * 0" # Runs every Sunday at 03:00 UTC | ||
- cron: "0 3 * * 0" # Runs every Sunday at 03:00 UTC | ||
workflow_dispatch: # Allow manual triggering | ||
|
||
inputs: | ||
branchName: | ||
description: 'Branch used as target for automation' | ||
required: true | ||
default: 'main' | ||
jobs: | ||
update-steps: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Step 2: Set up Python | ||
- name: Set up Python | ||
|
@@ -34,7 +41,14 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Step 5: Determine the PR Version Number | ||
- name: Script to check if branch exists to not commit again | ||
run: |- | ||
branch=$(curl -X GET -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/mozilla-mobile/firefox-ios/branches?per_page=100 | jq -r '.[].name | select(contains("update-bitrise-steps-${{ env.next_version }}"))') | ||
echo $branch | ||
if [ -z "$branch" ]; then echo "BRANCH_CREATED=false" >> $GITHUB_ENV; else echo "BRANCH_CREATED=true" >> $GITHUB_ENV;fi | ||
# Step 5: Determine PR Version Number | ||
- name: Determine PR Version Number | ||
id: versioning | ||
run: | | ||
|
@@ -51,25 +65,28 @@ jobs: | |
# Step 6: Check for changes | ||
- name: Commit changes if any | ||
if: env.BRANCH_CREATED == 'false' | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git diff | ||
git diff --quiet || (git add bitrise.yml && git commit -m "Update outdated Bitrise steps") | ||
git diff --quiet || (git add bitrise.yml) | ||
# Step 7: Create a Pull Request | ||
- name: Create a Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
if: env.BRANCH_CREATED == 'false' | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: update/bitrise-steps | ||
commit-message: "Update [v${{ env.next_version }}] outdated Bitrise steps ${{ env.current_date }}" | ||
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
committer: GitHub <[email protected]> | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: update-bitrise-steps-${{ env.next_version }} | ||
title: "Bump [v${{ env.next_version }}] Update outdated Bitrise steps ${{ env.current_date }}" | ||
delete-branch: true | ||
body: | | ||
This PR updates the outdated Bitrise steps to their latest versions. | ||
reviewers: mdotb-moz,clarmso,isabelrios | ||
|
||
# Step 8: Send a message to slack if there is a failure | ||
reviewers: mdotb-moz,isabelrios,clarmso | ||
# Step 8: Send a message to slack if there is a failure | ||
notify-on-failure: | ||
runs-on: ubuntu-latest | ||
needs: update-steps | ||
|
@@ -87,5 +104,4 @@ jobs: | |
GITHUB_REPOSITORY: ${{ github.repository }} | ||
GITHUB_RUNID: ${{ github.run_id }} | ||
GITHUB_REF_NAME: ${{ github.ref_name }} | ||
GITHUB_SHA: ${{ github.sha }} | ||
|
||
GITHUB_SHA: ${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.