-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'icon-updates-chore/changeOutput' into chore/changeOutput
- Loading branch information
Showing
8 changed files
with
4,942 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Copy content to other repository | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
repo: | ||
required: true | ||
type: string | ||
branch: | ||
required: true | ||
type: string | ||
source_dir: | ||
required: true | ||
type: string | ||
destination_dir: | ||
required: true | ||
type: string | ||
secrets: | ||
PAT: | ||
required: true | ||
|
||
jobs: | ||
copy_content: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if existing tokens branch exists | ||
id: check_branch | ||
run: echo "branch_exists=$(git ls-remote --heads https://github.com/${{ inputs.repo }}.git refs/heads/${{ inputs.branch }} | wc -l)" >> $GITHUB_OUTPUT | ||
- name: Check if open PR exists | ||
id: check_pr | ||
run: echo "pr_exists=$(gh pr list -R ${{ inputs.repo }} -H ${{ inputs.branch }} --json number -q length)" >> $GITHUB_OUTPUT | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Pull latest changes | ||
run: git pull | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT | ||
- name: Push files if branch exists | ||
uses: dmnemec/copy_file_to_another_repo_action@main | ||
if: ${{ steps.outputs.check_branch.branch_exists == 1 }} | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.PAT }} | ||
with: | ||
source_file: ${{ inputs.source_dir }} | ||
destination_repo: ${{ inputs.repo }} | ||
destination_folder: ${{ inputs.destination_dir }} | ||
destination_branch: ${{ inputs.branch }} | ||
user_email: "[email protected]" | ||
user_name: "Zeta Tokens Bot" | ||
commit_message: "deps(automated): Update tokens ${{ steps.date.outputs.date }}" | ||
- name: Push files if branch does not exist | ||
uses: dmnemec/copy_file_to_another_repo_action@main | ||
if: ${{ steps.outputs.check_branch.branch_exists == 0 }} | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.PAT }} | ||
with: | ||
source_file: ${{ inputs.source_dir }} | ||
destination_repo: ${{ inputs.repo }} | ||
destination_folder: ${{ inputs.destination_dir }} | ||
destination_branch_create: ${{ inputs.branch }} | ||
user_email: "[email protected]" | ||
user_name: "Zeta Tokens Bot" | ||
commit_message: "deps(automated): Update tokens ${{ steps.date.outputs.date }}" | ||
- name: Open PR | ||
uses: thecanadianroot/[email protected] | ||
if: ${{ steps.outputs.check_pr.pr_exists == 0 }} | ||
with: | ||
token: ${{ secrets.PAT }} | ||
base: main | ||
head: ${{ inputs.branch }} | ||
title: "deps(automated): Update tokens" | ||
labels: tokens | ||
body: "Update tokens ${{ steps.date.outputs.date }}" | ||
repository: ${{ inputs.repo }} | ||
- name: Add comment to existing PR | ||
env: | ||
GH_TOKEN: ${{ secrets.PAT }} | ||
if: ${{ steps.outputs.check_pr.pr_exists != 0 }} | ||
run: gh pr comment -R ${{ inputs.repo }} ${{ inputs.branch }} --body "Update tokens ${{ steps.date.outputs.date }}" |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.