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

github-actions: use GH app to manage the projects #236

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 12 additions & 3 deletions .github/workflows/addToProject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: Auto Assign to Project(s)
on:
issues:
types: [opened, edited, milestoned]
env:
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}

permissions:
contents: read

Expand All @@ -14,10 +11,22 @@ jobs:
runs-on: ubuntu-latest
name: Assign milestoned to Project
steps:
- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"repository_projects": "write"
v1v marked this conversation as resolved.
Show resolved Hide resolved
}
- name: Assign issues with milestones to project
uses: elastic/[email protected]
if: github.event.issue && github.event.issue.milestone
with:
project: 'https://github.com/orgs/elastic/projects/454'
project_id: '5882982'
column_name: 'Planned'
env:
MY_GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
22 changes: 17 additions & 5 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
types: [opened]
pull_request_target:
types: [opened]
env:
MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}

permissions:
contents: read
Expand All @@ -16,6 +14,17 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"members": "read",
"repository_projects": "write"
v1v marked this conversation as resolved.
Show resolved Hide resolved
}
- name: Add agent-ios and agent-mobile labels
uses: AlexanderWert/[email protected]
with:
Expand All @@ -29,10 +38,11 @@ jobs:
username: ${{ github.actor }}
team: 'apm'
usernamesToExclude: |
apmmachine
dependabot
dependabot[bot]
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
elastic-observability-automation
elastic-observability-automation[bot]
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
- name: Show team membership
run: |
echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
Expand All @@ -50,4 +60,6 @@ jobs:
with:
project: 'https://github.com/orgs/elastic/projects/454'
project_id: '5882982'
column_name: 'In Progress'
column_name: 'In Progress'
env:
MY_GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
Loading