[Do Not Merge] Sample for help text in individual radio button #2207
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: Automatically Sync PR with Base Branch | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Configure Git Identity | |
run: | | |
git config --global user.email "ci-build@aemforms" | |
git config --global user.name "ci-build" | |
- name: Validate branch names | |
id: validate | |
run: | | |
echo "Validating branch names..." | |
if ! [[ "${{ github.event.pull_request.head.ref }}" =~ ^[a-zA-Z0-9._/-]+$ ]]; then | |
echo "Invalid characters in head ref" | |
exit 1 | |
fi | |
if ! [[ "${{ github.event.pull_request.base.ref }}" =~ ^[a-zA-Z0-9._/-]+$ ]]; then | |
echo "Invalid characters in base ref" | |
exit 1 | |
fi | |
echo "::set-output name=head_ref::${{ github.event.pull_request.head.ref }}" | |
echo "::set-output name=base_ref::${{ github.event.pull_request.base.ref }}" | |
- name: Sync with Base Branch | |
run: | | |
git fetch origin ${{ steps.validate.outputs.head_ref }} | |
git fetch origin ${{ steps.validate.outputs.base_ref }} | |
git checkout ${{ steps.validate.outputs.base_ref }} | |
git pull origin ${{ steps.validate.outputs.base_ref }} | |
git checkout ${{ steps.validate.outputs.head_ref }} | |
git pull origin ${{ steps.validate.outputs.head_ref }} | |
git rebase ${{ steps.validate.outputs.base_ref }} | |
git push --force origin ${{ steps.validate.outputs.head_ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |