Skip to content

Commit

Permalink
Merge pull request #121 from SURYAKANTSHARMA/feature/AddBuildStatus-
Browse files Browse the repository at this point in the history
Add update read me workflow
  • Loading branch information
SURYAKANTSHARMA authored May 4, 2024
2 parents b852bd5 + b3b001f commit 4253fb8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/update-readme.yml
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

# CountryPicker
[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/vsouza/awesome-ios)
[![Build Status](https://app.travis-ci.com/SURYAKANTSHARMA/CountryPicker.svg?branch=master)](https://app.travis-ci.com/github/SURYAKANTSHARMA/CountryPicker)
[![Build Status](https://img.shields.io/badge/Build-BUILD_STATUS_PLACEHOLDER-red)](https://github.com/SURYAKANTSHARMA/CountryPicker/actions)

<!-- Your project description and other contents below -->

[![codecov](https://codecov.io/gh/SURYAKANTSHARMA/CountryPicker/branch/master/graph/badge.svg)](https://codecov.io/gh/SURYAKANTSHARMA/CountryPicker)
![Version Badge](https://img.shields.io/github/v/release/SURYAKANTSHARMA/CountryPicker?style=flat)
Expand Down

0 comments on commit 4253fb8

Please sign in to comment.