mirror of
https://github.com/logos-storage/logos-storage-pm.git
synced 2026-01-02 13:33:12 +00:00
Remove all workflows from codex-pm
This commit is contained in:
parent
8f5c9be368
commit
1fc8a86a8f
72
.github/scripts/vacuum.py
vendored
72
.github/scripts/vacuum.py
vendored
@ -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)
|
||||
15
.github/workflows/add-action-project.yml
vendored
15
.github/workflows/add-action-project.yml
vendored
@ -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 }}
|
||||
30
.github/workflows/add-labels-to-issues.yml
vendored
30
.github/workflows/add-labels-to-issues.yml
vendored
@ -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
|
||||
35
.github/workflows/restore_labels.yml
vendored
35
.github/workflows/restore_labels.yml
vendored
@ -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
|
||||
69
.github/workflows/sync-labels.yml
vendored
69
.github/workflows/sync-labels.yml
vendored
@ -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
|
||||
38
.github/workflows/vacuum.yml
vendored
38
.github/workflows/vacuum.yml
vendored
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user