Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,46 @@ jobs:
env:
GITHUB_TOKEN: ${{ steps.credentials.outputs.token }}
VERSION: ${{ steps.version.outputs.latest }}
skill:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: This job is a copy of the golang job above. It uses the same daily schedule, token, labels, and milestone, so there's nothing new to maintain.

name: Sync the agent skill
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions:
contents: none # Permissions are set with an application token
steps:
- name: Gather credentials
id: credentials
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ secrets.GH_APP_CLIENT_ID_RELEASER }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY_RELEASER }}
Comment on lines +100 to +102

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐙 suggestion: Perhaps we can scope the app token to what this job needs? zizmor flags github-app here since the token inherits all of the installation permissions. The golang job could follow in a separate change I think.

Suggested change
with:
client-id: ${{ secrets.GH_APP_CLIENT_ID_RELEASER }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY_RELEASER }}
with:
client-id: ${{ secrets.GH_APP_CLIENT_ID_RELEASER }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY_RELEASER }}
permission-contents: write
permission-pull-requests: write

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great call @zimeg! Scoped to contents and pull-requests in e00279a. I'll follow up with the same scoping for the golang job in a separate PR.

permission-contents: write
permission-pull-requests: write
- name: Checkout the repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: true
ref: main
token: ${{ steps.credentials.outputs.token }}
- name: Download the latest skill
run: |
curl -fsSL "https://github.com/raw/slackapi/slack-skills-plugin/main/skills/slack-cli/SKILL.md" -o cmd/skill/SKILL.md

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: We download from the plugin's main branch because that's what npx skills installs. The -f flag fails the step on a 404 instead of writing an error page into SKILL.md.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁️‍🗨️ thought: Using curl is clever... I would've checked out the entire skills repo but let's not add complications if not needed of course!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The skill is a single file, so curl keeps it simple. If we ever bundle more of the plugin, checking out the repo would be the way to go.

- name: Open a change request
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git checkout -b chore-sync-skill
if git diff --quiet; then
echo "No changes to commit, exiting."
exit 0
fi
git commit --all -m "chore: sync the slack-cli skill from slack-skills-plugin"
# Replace the branch so an open change request has the latest skill and main
git push --force -u origin chore-sync-skill
if [ -n "$(gh pr list --head chore-sync-skill --state open --json number --jq '.[].number')" ]; then
echo "Updated the open change request, exiting."
exit 0
fi
gh pr create --title "chore: sync the slack-cli skill from slack-skills-plugin" --body "Automatic update to the latest \`slack-cli\` skill in [slackapi/slack-skills-plugin](https://github.com/slackapi/slack-skills-plugin/blob/main/skills/slack-cli/SKILL.md)" --milestone "Next Release" --label "code health" --label "semver:patch"
env:
GITHUB_TOKEN: ${{ steps.credentials.outputs.token }}
Loading