Skip to content

Commit

Permalink
Merge pull request #4 from RedEyeMods/updated/template/action-template
Browse files Browse the repository at this point in the history
Update Template 'action-template'
  • Loading branch information
wwwDayDream authored Jun 17, 2024
2 parents ec01399 + b212687 commit eff45fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
36 changes: 1 addition & 35 deletions .github/workflows/organization-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,45 +61,11 @@ jobs:
source-repo: ${{ env.SOURCE_REPO }}

- name: Copy Repo Settings
uses: RedEyeMods/[email protected].5
uses: RedEyeMods/[email protected].6
with:
token: ${{ secrets.ORG_PAT }}
source-repo: ${{ env.SOURCE_REPO }}

- name: Copy Misc Settings
uses: actions/github-script@v7
with:
github-token: ${{ secrets.ORG_PAT }}
script: |
async function main() {
const [currentOwner, currentRepo] = process.env.CUR_REPO.split('/');
const [targetOwner, targetRepo] = process.env.TARGET_REPO.split('/');
const defProtRules = await github.rest.repos.get({
owner: targetOwner, repo: targetRepo
});

await github.rest.repos.update({
owner: currentOwner, repo: currentRepo,
allow_squash_merge: defProtRules.data.allow_squash_merge,
allow_merge_commit: defProtRules.data.allow_merge_commit,
allow_rebase_merge: defProtRules.data.allow_rebase_merge,
allow_auto_merge: defProtRules.data.allow_auto_merge,
delete_branch_on_merge: defProtRules.data.delete_branch_on_merge,
allow_update_branch: defProtRules.data.allow_update_branch,
use_squash_pr_title_as_default: defProtRules.data.use_squash_pr_title_as_default,
squash_merge_commit_message: defProtRules.data.squash_merge_commit_message,
squash_merge_commit_title: defProtRules.data.squash_merge_commit_title,
merge_commit_message: defProtRules.data.merge_commit_message,
merge_commit_title: defProtRules.data.merge_commit_title
})
}

main().catch(error => {
console.error(error);
process.exit(1);
});

one-time:
name: Execute One Time
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/organization-template-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ jobs:
run: |
git push --set-upstream origin ${{ env.PR_BRANCH }}
gh pr create --base ${{ matrix.target-repo.default_branch }} --head ${{ env.PR_BRANCH }} --title "Update Template '${{ github.event.repository.name }}'" --body "" || echo "PR already exists or another error occurred"
gh pr view --json url -t '{{.url}}' >> $GITHUB_STEP_SUMMARY

0 comments on commit eff45fb

Please sign in to comment.