Update Master #111
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
name: Update Master | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.WORKFLOW_INTERMEDIA_TOKEN }} | |
ref: master | |
fetch-depth: 0 | |
- name: Set up upstream | |
run: | | |
if ! git remote | grep -q "upstream"; then | |
git remote add upstream https://github.com/pjsip/pjproject.git | |
fi | |
- name: Fetch upstream | |
run: git fetch upstream | |
- name: Configure git | |
run: | | |
git config user.name "CI Bot" | |
git config user.email "[email protected]" | |
- name: Merge upstream/master into master | |
run: | | |
if ! git merge -m "Merge upstream/master into master" upstream/master; then | |
git merge --abort | |
exit 1 | |
fi | |
- name: Push changes | |
if: ${{ success() }} | |
run: git push origin master | |
- name: Success step | |
if: ${{ success() }} | |
run: | | |
curl -X POST --data-urlencode "payload={\"channel\": \"#unite-mobile-pjproject\", \"username\": \"ci-bot\", \"text\": \":azure-check-mark: *Merge upstream/master to master* successful! <https://github.com/intermedia-net/pjproject/actions/workflows/update-master.yml|Click here> for details! \", \"icon_emoji\": \":unite:\"}" ${{ secrets.SLACK_WEBHOOK_URL }} | |
- name: Failure step | |
if: ${{ failure() }} | |
run: | | |
curl -X POST --data-urlencode "payload={\"channel\": \"#unite-mobile-pjproject\", \"username\": \"ci-bot\", \"text\": \":azure-x-mark: *Upstream/master to master merge* conflict detected! <https://github.com/intermedia-net/pjproject/actions/workflows/update-master.yml|Click here> for details! \", \"icon_emoji\": \":unite:\"}" ${{ secrets.SLACK_WEBHOOK_URL }} |