Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
a4e530e3
Unverified
Commit
a4e530e3
authored
May 13, 2024
by
Younes Belkada
Committed by
GitHub
May 13, 2024
Browse files
Workflow: Replace `actions/post-slack` with centrally defined workflow (#30737)
* Remove commit details * remove old workflow
parent
de6e0db1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
81 deletions
+2
-81
.github/actions/post-slack/action.yml
.github/actions/post-slack/action.yml
+0
-79
.github/workflows/push-important-models.yml
.github/workflows/push-important-models.yml
+2
-2
No files found.
.github/actions/post-slack/action.yml
deleted
100644 → 0
View file @
de6e0db1
name
:
Send message to slack
description
:
'
Send
results
to
slack'
author
:
'
Hugging
Face'
inputs
:
slack_channel
:
required
:
true
type
:
string
title
:
required
:
true
type
:
string
status
:
required
:
true
type
:
string
slack_token
:
required
:
true
type
:
string
runs
:
using
:
"
composite"
steps
:
-
name
:
Create content to post
id
:
create-message
run
:
|
if [ "${{ inputs.status }}" == "success" ]; then
echo STATUS_MESSAGE='🟢 Tests are passing!' >> $GITHUB_ENV
else
echo STATUS_MESSAGE='🔴 Tests failed! Please check the GitHub action link below' >> $GITHUB_ENV
fi
shell
:
bash
-
name
:
Post Canceled results Slack channel
id
:
post-slack
uses
:
slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
with
:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
channel-id
:
${{ inputs.slack_channel }}
# For posting a rich message using Block Kit
payload
:
|
{
"text": "${{ inputs.title }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ inputs.title }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.STATUS_MESSAGE }}"
}
},
{
"type": "section",
"text": {"type": "mrkdwn", "text": "*Click the button for more details about the commit*"},
"accessory": {
"type": "button",
"text": {"type": "plain_text", "text": "Check Commit results"},
"url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
},
{
"type": "section",
"text": {"type": "mrkdwn", "text": "*Click here for more details about the action ran*"},
"accessory": {
"type": "button",
"text": {"type": "plain_text", "text": "Check Action results"},
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
env
:
SLACK_BOT_TOKEN
:
${{ inputs.slack_token }}
\ No newline at end of file
.github/workflows/push-important-models.yml
View file @
a4e530e3
...
@@ -97,7 +97,7 @@ jobs:
...
@@ -97,7 +97,7 @@ jobs:
-
name
:
Post to Slack
-
name
:
Post to Slack
if
:
always()
if
:
always()
uses
:
.
/.github/actions/post-slack
uses
:
huggingface/hf-workflows
/.github/actions/post-slack
@main
with
:
with
:
slack_channel
:
${{ env.OUTPUT_SLACK_CHANNEL_ID }}
slack_channel
:
${{ env.OUTPUT_SLACK_CHANNEL_ID }}
title
:
🤗 Results of the FA2 tests - ${{ matrix.model-name }}
title
:
🤗 Results of the FA2 tests - ${{ matrix.model-name }}
...
@@ -119,7 +119,7 @@ jobs:
...
@@ -119,7 +119,7 @@ jobs:
-
name
:
Post to Slack
-
name
:
Post to Slack
if
:
always()
if
:
always()
uses
:
.
/.github/actions/post-slack
uses
:
huggingface/hf-workflows
/.github/actions/post-slack
@main
with
:
with
:
slack_channel
:
${{ env.OUTPUT_SLACK_CHANNEL_ID }}
slack_channel
:
${{ env.OUTPUT_SLACK_CHANNEL_ID }}
title
:
🤗 Results of the Integration tests - ${{ matrix.model-name }}
title
:
🤗 Results of the Integration tests - ${{ matrix.model-name }}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment