Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "chore(IDX): simplify repo policies workflow" #107

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/repo_policies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Repository Policies

on:
workflow_call:

jobs:
check-bot-policies:
name: Check Bot Policies
runs-on: ubuntu-latest
# Dont run this workflow on merge queue
if: ${{ github.event_name != 'merge_group' }}
steps:
# First check out code from public-workflows
- name: Checkout
uses: actions/checkout@v4
with:
repository: dfinity/public-workflows
path: public-workflows

# Then switch back to this repository to make sure it's run from current
- name: Checkout Original Repository
uses: actions/checkout@v4
with:
path: current-repo # need to specify another path to avoid overwriting the first checkout
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
fetch-depth: 50

- name: Python Setup
uses: ./public-workflows/.github/workflows/python-setup
with:
working-directory: public-workflows

- name: Bot Checks
id: bot-checks
run: |
set -euo pipefail
export PYTHONPATH="$PWD/public-workflows/reusable_workflows/"
python public-workflows/reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ORG: ${{ github.repository_owner }}
USER: ${{ github.event.pull_request.user.login }}
REPO: ${{ github.event.repository.name }}
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
REPO_PATH: current-repo
47 changes: 4 additions & 43 deletions .github/workflows/repo_policies_ruleset.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# triggered on all repositories that use the PR creation Bot
# triggered on all repositories via rulesets

name: Repo Policies Ruleset

Expand All @@ -7,45 +7,6 @@ on:
merge_group:

jobs:
check-bot-policies:
name: Check Bot Policies
runs-on: ubuntu-latest
# Dont run this workflow on merge queue
if: ${{ github.event_name != 'merge_group' }}
steps:
# First check out code from public-workflows
- name: Checkout
uses: actions/checkout@v4
with:
repository: dfinity/public-workflows
path: public-workflows

# Then switch back to this repository to make sure it's run from current
- name: Checkout Original Repository
uses: actions/checkout@v4
with:
path: current-repo # need to specify another path to avoid overwriting the first checkout
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
fetch-depth: 50

- name: Python Setup
uses: ./public-workflows/.github/workflows/python-setup
with:
working-directory: public-workflows

- name: Bot Checks
id: bot-checks
run: |
set -euo pipefail
export PYTHONPATH="$PWD/public-workflows/reusable_workflows/"
python public-workflows/reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ORG: ${{ github.repository_owner }}
USER: ${{ github.event.pull_request.user.login }}
REPO: ${{ github.event.repository.name }}
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
REPO_PATH: current-repo
call-repo-policies:
uses: dfinity/public-workflows/.github/workflows/repo_policies.yml@main
secrets: inherit