-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from SURYAKANTSHARMA/feature/AddBuildStatus-
Add update read me workflow
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Update README | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Swift"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
update-readme: | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'success' | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update README | ||
run: | | ||
status=${{ job.status }} | ||
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then | ||
status="passed" | ||
fi | ||
if [[ "${{ github.event.workflow_run.conclusion }}" == "failure" ]]; then | ||
status="failed" | ||
fi | ||
sed -i "s/BUILD_STATUS_PLACEHOLDER/${status}/g" README.md | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git add README.md | ||
git commit -m "Update README with build status" | ||
git push |
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