Skip to content

Commit

Permalink
Merge pull request #2375 from Kaiserdragon2/Appfilter2Pages
Browse files Browse the repository at this point in the history
Create fetch-and-push.yml
  • Loading branch information
Kaiserdragon2 authored Dec 1, 2024
2 parents 75b86c6 + 31fd34f commit 7275c9b
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/fetch-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Fetch and Push File

on:
push:
branches:
- main
paths:
- 'newicons/appfilter.xml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: fetch-and-push
cancel-in-progress: true

jobs:
fetch_and_push_file:
runs-on: ubuntu-latest

env:
SOURCE_BRANCH: main
TARGET_BRANCH: Arcticons-Pages
FILE_PATH: newicons/appfilter.xml

steps:
# Step 1: Checkout the repository
- name: Checkout main Repository
uses: actions/checkout@v4
with:
ref: main
path: main

# Step 2: Checkout the 2. repository
- name: Checkout Arcticons-Pages Repository
uses: actions/checkout@v4
with:
ref: Arcticons-Pages
path: pages

# Step 3: Fetch the file from the source branch
- name: Copy File from main to Arcticons-Pages
run: |
rm pages/newicons/appfilter.xml
cp main/newicons/appfilter.xml pages/newicons/appfilter.xml
# Step 4: Commit and push changes
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd pages
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add $FILE_PATH
git commit -m "Update $FILE_PATH from $SOURCE_BRANCH to $TARGET_BRANCH"
git push

0 comments on commit 7275c9b

Please sign in to comment.