From 84382abc42a73eacfa5fc3f36ee1fe4292ffe36a Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Mon, 15 Sep 2025 15:41:25 +1000 Subject: [PATCH] Remove all workflows from codex-pm (#242) --- .github/scripts/vacuum.py | 72 ---------------------- .github/workflows/add-action-project.yml | 15 ----- .github/workflows/add-labels-to-issues.yml | 30 --------- .github/workflows/restore_labels.yml | 35 ----------- .github/workflows/sync-labels.yml | 69 --------------------- .github/workflows/vacuum.yml | 38 ------------ 6 files changed, 259 deletions(-) delete mode 100644 .github/scripts/vacuum.py delete mode 100644 .github/workflows/add-action-project.yml delete mode 100644 .github/workflows/add-labels-to-issues.yml delete mode 100644 .github/workflows/restore_labels.yml delete mode 100644 .github/workflows/sync-labels.yml delete mode 100644 .github/workflows/vacuum.yml diff --git a/.github/scripts/vacuum.py b/.github/scripts/vacuum.py deleted file mode 100644 index 511efca..0000000 --- a/.github/scripts/vacuum.py +++ /dev/null @@ -1,72 +0,0 @@ -import os -import requests -import json -from datetime import datetime, timedelta - -# Replace with your GitHub username, organization, and personal access token -username = "JessieBroke" -organization = "codex-storage" -token = os.getenv("GH_PAT") - -# GitHub API endpoint for listing repositories in the organization -repositories_url = f"https://api.github.com/orgs/{organization}/repos" - -# Fetch repositories -response = requests.get(repositories_url, headers={"Authorization": f"Bearer {token}"}) -repositories_data = response.json() - -# Extract repository names from the response -repositories = [repo["name"] for repo in repositories_data] - -# Calculate the datetime 72 hours ago from now -time_threshold = datetime.utcnow() - timedelta(hours=72) - -# Create a dictionary to store unique issues based on the combination of issue URL and label name -unique_issues = {} - -# Iterate through each repository -for repository in repositories: - # GitHub API endpoint for listing issue events - api_url = f"https://api.github.com/repos/{organization}/{repository}/issues/events" - - # Fetch issue events - response = requests.get(api_url, headers={"Authorization": f"Bearer {token}"}) - events = response.json() - - # Iterate through each event in the list - for event in events: - # Extracting information for each event - event_type = event.get('event') - created_at_str = event.get('created_at') - - # Convert created_at string to datetime object - created_at = datetime.strptime(created_at_str, "%Y-%m-%dT%H:%M:%SZ") - - # Check if the event is 'unlabeled' and updated in the past 48 hours - if event_type == 'unlabeled' and created_at > time_threshold: - actor_login = event.get('actor', {}).get('login') - label_name = event.get('label', {}).get('name') - label_color = event.get('label', {}).get('color') - issue_url = event.get('issue', {}).get('html_url') - - if actor_login and label_name and label_color and issue_url: - # Use a unique identifier for each issue-label combination - unique_identifier = f"{issue_url}_{label_name}" - - # Check if the unique identifier is not already in the dictionary - if unique_identifier not in unique_issues: - unique_issues[unique_identifier] = { - 'login': actor_login, - 'label_name': label_name, - 'label_color': label_color, - 'issue_url': issue_url - } - -# Convert the dictionary values to a list -filtered_data = list(unique_issues.values()) - -# Write the filtered data to a new JSON file -output_path = os.path.join("output", "vacuum_data.json") -os.makedirs(os.path.dirname(output_path), exist_ok=True) -with open(output_path, 'w') as output_file: - json.dump(filtered_data, output_file, indent=2) diff --git a/.github/workflows/add-action-project.yml b/.github/workflows/add-action-project.yml deleted file mode 100644 index f94e559..0000000 --- a/.github/workflows/add-action-project.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Add new issues to Codex project board - -on: - issues: - types: [opened] - -jobs: - add-to-project: - name: Add issue to project - runs-on: ubuntu-latest - steps: - - uses: actions/add-to-project@v0.3.0 - with: - project-url: https://github.com/orgs/codex-storage/projects/2 - github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} \ No newline at end of file diff --git a/.github/workflows/add-labels-to-issues.yml b/.github/workflows/add-labels-to-issues.yml deleted file mode 100644 index a00c656..0000000 --- a/.github/workflows/add-labels-to-issues.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Add Label to Issues -on: - push: - branches: - - master - -jobs: - add-label: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Add label to open issues in "test1" repository - run: | - REPO="TheBasedmint/test1" - LABEL="Marketplace" - - # Fetch open issues - for issue in $(curl -s -H "Authorization: Bearer ${{ secrets.SYNC_LABELS2 }}" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/$REPO/issues?state=open" | jq -r '.[].number'); do - - # Apply label to each open issue - curl -X POST -H "Authorization: Bearer ${{ secrets.SYNC_LABELS2 }}" \ - -H "Accept: application/vnd.github.v3+json" \ - -d "{\"labels\": [\"$LABEL\"]}" \ - "https://api.github.com/repos/$REPO/issues/$issue/labels" - done diff --git a/.github/workflows/restore_labels.yml b/.github/workflows/restore_labels.yml deleted file mode 100644 index 45e4705..0000000 --- a/.github/workflows/restore_labels.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Restore Labels - -on: - workflow_dispatch: - -jobs: - restore-labels: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.x - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - - name: Restore Labels - run: | - python .github/scripts/restore_labels.py - env: - GH_PAT: ${{ secrets.SYNC_LABELS2 }} - working-directory: ${{ github.workspace }} - - - name: Upload issue events as artifact - uses: actions/upload-artifact@v2 - with: - name: issue-events - path: issue_events.json \ No newline at end of file diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml deleted file mode 100644 index 1a7394a..0000000 --- a/.github/workflows/sync-labels.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Sync labels -on: - push: - branches: - - master - paths: - - .github/labels.yml - - .github/workflows/sync-labels.yml - workflow_dispatch: - -permissions: - issues: write - -jobs: - sync-labels: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: micnncim/action-label-syncer@v1 - with: - manifest: .github/labels.yml - repository: | - codex-storage/cs-codex-dist-tests - codex-storage/nim-codex - codex-storage/codex-contracts-eth - codex-storage/nim-poseidon2 - codex-storage/codex-frontend - codex-storage/codex-research - codex-storage/nim-chronos - codex-storage/zk-benchmarks - codex-storage/multicodec - codex-storage/constantine - codex-storage/codex-storage-proofs-circuits - codex-storage/codex-pm - codex-storage/codex.storage - codex-storage/nim-ethers - codex-storage/logtools - codex-storage/nim-libp2p - codex-storage/nim-datastore - codex-storage/das-research - codex-storage/nim-codex-dht - codex-storage/das-dht-emulator - codex-storage/swarmsim - codex-storage/questionable - codex-storage/nim-contract-abi - codex-storage/asynctest - codex-storage/dist-tests-prometheus - codex-storage/dist-tests-geth - codex-storage/codex-storage-proofs - codex-storage/network-testing-codex - codex-storage/rs-poseidon - codex-storage/nim-leopard - codex-storage/nim-nitro - codex-storage/zk-research-artifacts - codex-storage/debugging-scratchpad - codex-storage/infra-codex - codex-storage/infra-docs - codex-storage/codex-incentives - codex-storage/apatheia - codex-storage/nim-chroprof - codex-storage/codex-testnet-starter - codex-storage/docs.codex.storage - codex-storage/guide.codex.storage - codex-storage/nim-circom-compat - codex-storage/circom-compat-ffi - codex-storage/circom-compat - codex-storage/nim-serde - token: ${{ secrets.SYNC_LABELS2 }} - prune: false \ No newline at end of file diff --git a/.github/workflows/vacuum.yml b/.github/workflows/vacuum.yml deleted file mode 100644 index 2bfd9fb..0000000 --- a/.github/workflows/vacuum.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Vacuum - -on: - push: - branches: - - master - -jobs: - vacuum: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.x - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - - name: Run Vacuum script - run: | - python .github/scripts/vacuum.py - env: - GH_PAT: ${{ secrets.SYNC_LABELS2 }} - working-directory: ${{ github.workspace }} - - - name: Upload issue events as artifact - uses: actions/upload-artifact@v2 - with: - name: issue-events - path: output/*.json - if-no-files-found: warn \ No newline at end of file