Skip to content

Commit

Permalink
Push directly
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoch committed Sep 25, 2021
1 parent 1248b54 commit 1897bc5
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/generate-opensource-interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,14 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout New Branch
- name: Push to master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_AGAINST: "master"
run: |
printf "GitHub Actor: ${GITHUB_ACTOR}\n"
export BRANCH_FROM="opensource-heartbeat/update-$(date '+%Y-%m-%d')"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
BRANCH_EXISTS=$(git ls-remote --heads origin ${BRANCH_FROM})
if [[ -z ${BRANCH_EXISTS} ]]; then
printf "Branch does not exist in remote.\n"
else
printf "Branch already exists in remote.\n"
exit 1
fi
git branch
git checkout -b "${BRANCH_FROM}" || git checkout "${BRANCH_FROM}"
git branch
git add docs/*
git add docs/_events/*
Expand All @@ -47,22 +35,9 @@ jobs:
git status
if git diff-index --quiet HEAD --; then
export OPEN_PULL_REQUEST=0
printf "No changes\n"
else
export OPEN_PULL_REQUEST=1
printf "Changes\n"
git commit -a -m "Automated deployment to update events $(date '+%Y-%m-%d')"
git push origin "${BRANCH_FROM}"
git push origin master
fi
echo "OPEN_PULL_REQUEST=${OPEN_PULL_REQUEST}" >> $GITHUB_ENV
echo "PULL_REQUEST_FROM_BRANCH=${BRANCH_FROM}" >> $GITHUB_ENV
echo "PULL_REQUEST_TITLE=[opensource-heartbeat] ${BRANCH_FROM}" >> $GITHUB_ENV
echo "PULL_REQUEST_BODY=Opensource Heartbeat events update automated pull request." >> $GITHUB_ENV
- name: Open Pull Request
uses: vsoch/pull-request-action@1.0.12
if: ${{ env.OPEN_PULL_REQUEST == '1' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_BRANCH: "master"

0 comments on commit 1897bc5

Please sign in to comment.