File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939
4040 - name : Create and push branch with changes
4141 run : |
42+ BRANCH_NAME="update-filtered-data-${{ github.ref_name }}"
43+
44+ # Check if branch exists locally and delete it
45+ if git branch --list "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
46+ git branch -D "$BRANCH_NAME"
47+ fi
48+
49+ # Check if branch exists on remote and delete it
50+ if git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
51+ git push origin --delete "$BRANCH_NAME"
52+ fi
53+
4254 # Create and switch to new branch
43- git checkout -b update-filtered-data-${{ github.ref_name }}
55+ git checkout -b "$BRANCH_NAME"
4456
4557 # Add changes
4658 git add ./data/govuk-frontend-dependents.json
5567 git commit -m "Get latest filtered dependents data and rejections - ${{ github.ref_name }}"
5668
5769 # Push branch
58- git push origin update-filtered-data-${{ github.ref_name }}
70+ git push origin "$BRANCH_NAME"
5971
6072 - name : Create or update pull request
6173 run : |
You can’t perform that action at this time.
0 commit comments