Skip to content

Commit 0f06725

Browse files
authored
Update update_json_date.yml
1 parent 5c16955 commit 0f06725

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/update_json_date.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,14 @@ jobs:
1616
steps:
1717
- name: Check out repository
1818
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }} # Stellt sicher, dass der PR-Branch ausgecheckt wird
1921

2022
- name: Configure Git user
2123
run: |
2224
git config --global user.email "github-actions[bot]@users.noreply.github.com"
2325
git config --global user.name "github-actions[bot]"
2426
25-
- name: Get the PR branch
26-
run: |
27-
echo "Fetching PR branch"
28-
PR_BRANCH=$(jq --raw-output .pull_request.head.ref "$GITHUB_EVENT_PATH")
29-
echo "PR Branch is $PR_BRANCH"
30-
31-
- name: Checkout PR branch
32-
run: git checkout $PR_BRANCH
33-
3427
- name: Make script executable
3528
run: chmod +x .github/workflows/scripts/update_json_date.sh
3629

@@ -41,5 +34,11 @@ jobs:
4134
run: |
4235
git add *.json
4336
git diff --cached --quiet || git commit -m "Update JSON dates"
37+
38+
- name: Push changes with API keys
39+
env:
40+
JSON_API_ID: ${{ secrets.JSON_API_ID }}
41+
JSON_API_KEY: ${{ secrets.JSON_API_KEY }}
42+
run: |
43+
git remote set-url origin https://$JSON_API_ID:[email protected]/${{ github.repository }}.git
4444
git push
45-
continue-on-error: true

0 commit comments

Comments
 (0)