Skip to content

Commit

Permalink
Auto labels and draft (#7321)
Browse files Browse the repository at this point in the history
* test auto labeler

* fix

* permissions

* only do labels

* try gh cli

* try this

* try this for labels

* check repo

* check auth status

* set permissions at job level

* syntax

* simplify permissions

* test auto project labels

* make change in hourly

* undo change in hourly

* make change in solana

* also set as draft/ready when labels are set

* Revert "make change in solana"

This reverts commit 6643339.

* ok this doesn't work, lets try this action

* try gh cli

* try this with gh api

* try this

* try this ID??

* enable content permissions

* try gh CLI

* syntax

* final setup?

* add readme changes to each subproject to check labels

* add simple tokens readme

---------

Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com>
  • Loading branch information
0xRobin and jeff-dude authored Dec 16, 2024
1 parent f0b3045 commit c7237e7
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"dbt: daily":
- changed-files:
- any-glob-to-any-file: 'dbt_subprojects/daily_spellbook/**'

"dbt: dex":
- changed-files:
- any-glob-to-any-file: 'dbt_subprojects/dex/**'

"dbt: hourly":
- changed-files:
- any-glob-to-any-file: 'dbt_subprojects/hourly_spellbook/**'

"dbt: nft":
- changed-files:
- any-glob-to-any-file: 'dbt_subprojects/nft/**'

"dbt: solana":
- changed-files:
- any-glob-to-any-file: 'dbt_subprojects/solana/**'

"dbt: tokens":
- changed-files:
- any-glob-to-any-file: 'dbt_subprojects/tokens/**'
46 changes: 46 additions & 0 deletions .github/workflows/pr_automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PR automation

on:
pull_request:
types:
- opened
- ready_for_review
- converted_to_draft
- synchronize
- labeled

permissions:
pull-requests: write
contents: write

jobs:
pr-automation:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.number }}
steps:
- name: Mark new PR as Draft
if: (github.event.action == 'opened' && github.event.pull_request.draft == false)
run: gh pr ready "$NUMBER" --undo

- name: Set labels on Open
if: github.event.action == 'opened'
run: gh pr edit "$NUMBER" --add-label "WIP"

- name: Set labels on Draft
if: github.event.action == 'converted_to_draft'
run: gh pr edit "$NUMBER" --add-label "WIP" --remove-label "ready-for-review"

- name: Set labels on ready-for-review
if: github.event.action == 'ready_for_review'
run: gh pr edit "$NUMBER" --add-label "ready-for-review" --remove-label "WIP"

- name: Add subproject labels
if: contains('synchronize,opened,reopened', github.event.action)
uses: actions/labeler@v5
with:
sync-labels: true


1 change: 1 addition & 0 deletions dbt_subprojects/dex/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## DEX subproject


This is a DBT subproject for the main lineages of the DEX sector. Included in this subproject, but not limited to over time:
- `dex.trades`
- `dex_aggreagtor.trades`
Expand Down
2 changes: 1 addition & 1 deletion dbt_subprojects/hourly_spellbook/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Hourly Spellbook

This is a DBT sub project for the all hourly models in spellbook
This is a DBT sub project for the all hourly models in spellbook.
2 changes: 1 addition & 1 deletion dbt_subprojects/nft/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Daily Spellbook

This is a DBT sub project for the all the NFT related models in spellbook.
This is a DBT sub project for the all the NFT related models in spellbook
2 changes: 1 addition & 1 deletion dbt_subprojects/solana/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Solana subproject

This is a DBT subproject for the main lineages of Solana data.
This is a DBT subproject for the main lineages of Solana data
3 changes: 3 additions & 0 deletions dbt_subprojects/tokens/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Tokens subproject

This is a DBT subproject for the main lineages of tokens data

0 comments on commit c7237e7

Please sign in to comment.