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

Permissions #5

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
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
27 changes: 23 additions & 4 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,34 @@ name: CI

on:
push:
pull_request:

workflow_dispatch:

permissions:
contents: write # only for delete-branch option
#issues: write
pull-requests: write

jobs:
stale:
test-permissions:
runs-on: ubuntu-latest
steps:
- uses: akv-platform/stale@v-sdolin/push-ref
- name: debug
if: ${{ false }}
uses: akv-platform/stale@permissions
with:
debug-only: true
stale-pr-message: 'This PR is stale because it has been open for 45 days with no activity. Remove stale label or comment or this will be closed in 15 days.'
close-pr-message: 'This PR was closed because it has been stalled for 15 days with no activity.'
days-before-pr-stale: 30
days-before-pr-close: 15
delete-branch: true

- name: 'create comment to PR'
if: ${{ true }}
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
curl -L -X GET -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/akv-demo/test-stale/issues
# curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/akv-demo/test-stale/issues/2/comments -d "{\"body\":\"$(date)\"}"
# ull-requests: write curl -L -X PATCH -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/akv-demo/test-stale/pulls/2 -d '{"title":"new title","body":"updated body 2","state":"closed","base":"main"}'
# contents: write curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/akv-demo/test-stale/git/refs/heads/2del