Skip to content

Commit

Permalink
feat: add chanel switching action
Browse files Browse the repository at this point in the history
  • Loading branch information
Pikatsuto committed Jun 25, 2024
1 parent fdf4a24 commit 7cf6e86
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/auto_nigthly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_dispatch

jobs:
auto_nightly:
name: convert testing to nightly
runs-on: ubuntu-22.04
steps:
- name: pr_all_to_nightly
run: |
QUERY_RESULT=$(
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.RevoluNixPKGS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/search/repositories?q=pkg+user:RevoluNix"
)
PACKAGES_REPOSITROYS=$(
echo $QUERY_RESULT \
| jq -r ".items.[].full_name"
)
for REPOSITORY in "${PACKAGES_REPOSITROYS}"; do
gh pr create \
-R ${REPOSITORY} \
--head testing \
--base nightly \
--title "Switch testing chanel to nightly"
gh pr merge nightly \
-R ${REPOSITORY} \
-s \
--auto
done
33 changes: 33 additions & 0 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_dispatch

jobs:
auto_release:
name: convert nightly to release
runs-on: ubuntu-22.04
steps:
- name: pr_all_to_release
run: |
QUERY_RESULT=$(
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.RevoluNixPKGS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/search/repositories?q=pkg+user:RevoluNix"
)
PACKAGES_REPOSITROYS=$(
echo $QUERY_RESULT \
| jq -r ".items.[].full_name"
)
for REPOSITORY in "${PACKAGES_REPOSITROYS}"; do
gh pr create \
-R ${REPOSITORY} \
--head nightly \
--base main \
--title "Switch nightly chanel to main"
gh pr merge main \
-R ${REPOSITORY} \
-s \
--auto
done

0 comments on commit 7cf6e86

Please sign in to comment.