Skip to content

ApiSamples: Samples: Samples fixes for release #25382

ApiSamples: Samples: Samples fixes for release

ApiSamples: Samples: Samples fixes for release #25382

Workflow file for this run

name: Lint
on:
workflow_dispatch: { }
push:
pull_request:
types: [ opened, edited, synchronize, reopened ]
jobs:
common-check:
name: Common checks
uses: ./.github/workflows/common_check.yaml
with:
run_trigger: ${{ github.event_name }}
# super-linter:
# name: Super Lint Code Base
# needs: common-check
# runs-on: ubuntu-22.04
# if: needs.common-check.outputs.continue == 'true'
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# # Full git history is needed to get a proper list of changed files within `super-linter`
# fetch-depth: 0
# - name: Lint Code Base
# uses: github/[email protected]
# env:
# DISABLE_ERRORS: true
# DEFAULT_BRANCH: master
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# MULTI_STATUS: true
# LOG_LEVEL: WARN
# ERROR_ON_MISSING_EXEC_BIT: true
# SUPPRESS_FILE_TYPE_WARN: false
# JSCPD_CONFIG_FILE: .jscpd.json
# NATURAL_LANGUAGE_CONFIG_FILE: .textlintrc
# JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json
# TYPESCRIPT_ES_CONFIG_FILE: .eslintrc.json
# VALIDATE_ALL_CODEBASE: false
# IGNORE_GITIGNORED_FILES: true
# VALIDATE_BASH: true
# VALIDATE_BASH_EXEC: true
# VALIDATE_CPP: true
# VALIDATE_CLANG_FORMAT: true
# VALIDATE_CLOUDFORMATION: true
# VALIDATE_CSS: true
# VALIDATE_DART: true
# VALIDATE_DOCKERFILE_HADOLINT: true
# VALIDATE_EDITORCONFIG: true
# VALIDATE_GITHUB_ACTIONS: true
# VALIDATE_GITLEAKS: true
# VALIDATE_GOOGLE_JAVA_FORMAT: true
# VALIDATE_HTML: true
# VALIDATE_JAVA: true
# VALIDATE_JAVASCRIPT_ES: true
# VALIDATE_JSON: true
# VALIDATE_JSX: true
# VALIDATE_KUBERNETES_KUBEVAL: true
# VALIDATE_LUA: true
# VALIDATE_NATURAL_LANGUAGE: true
# VALIDATE_POWERSHELL: true
# VALIDATE_SHELL_SHFMT: true
# VALIDATE_TERRAFORM_TERRASCAN: true
# VALIDATE_TERRAFORM_TFLINT: true
# VALIDATE_TSX: true
# VALIDATE_TYPESCRIPT_ES: true
# VALIDATE_XML: true
# VALIDATE_YAML: true
markdown:
name: MarkdownLint
needs: common-check
runs-on: ubuntu-22.04
if: needs.common-check.outputs.continue == 'true'
permissions:
pull-requests: read
steps:
- name: Set git fetch depth
run: |
if [[ ${{ github.event_name }} != 'pull_request' ]]; then
echo "FETCH_DEPTH=2" >> "$GITHUB_ENV"
else
echo "FETCH_DEPTH=0" >> "$GITHUB_ENV"
fi
- uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- uses: tj-actions/changed-files@v42
id: changed-files
with:
files: '**/*.{md,mdx}'
separator: ","
- uses: DavidAnson/[email protected]
if: steps.changed-files.outputs.any_changed == 'true'
with:
globs: ${{ steps.changed-files.outputs.all_changed_files }}
separator: ","
fix: true
commit:
name: CommitLint
needs: common-check
runs-on: ubuntu-22.04
if: needs.common-check.outputs.continue == 'true'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install commitlint dependencies
run: npm install --location=global @commitlint/config-conventional @commitlint/cli
- uses: wagoid/commitlint-github-action@v5
with:
configFile: commitlint.config.js
failOnWarnings: false
helpURL: https://datagrok.ai/help/develop/advanced/git-policy#commit-message-policy
pr-name:
name: PR name
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: '18'
# https://github.com/JulienKode/pull-request-name-linter-action/issues/236
- name: Install commitlint dependencies
run: npm install @commitlint/config-conventional@v17 @commitlint/cli
- name: Commitlint PR title
uses: JulienKode/[email protected]
with:
configuration-path: ./commitlint.config.js
packages-links:
name: Packages links
runs-on: ubuntu-22.04
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check links in packages
shell: bash
continue-on-error: true
timeout-minutes: 15
id: test-links
run: |
test_result=$(./packages_help.sh)
if [ -z "$test_result" ]; then
echo "All tests finished successfully"
else
echo -e "${test_result}"
echo -e "SLACK_MESSAGE_BODY=${test_result}\n\n" | sed -e '$ ! s/$/\\n/' | tr -d '\n' >> $GITHUB_ENV
exit 1
fi
working-directory: packages/
- name: Prepare Slack Message
id: slack-prepare
if: ${{ steps.test-links.outcome == 'failure' }}
shell: bash
env:
SLACK_ID: ${{ secrets.SLACK_ID }}
run: |
channel_id=$(echo "$SLACK_ID" | jq -r .\"${{ github.actor }}\")
echo "::add-mask::$channel_id"
echo SLACK_CHANNEL=$channel_id >> $GITHUB_ENV
header="GitHub <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} ${{ github.run_number }}> found dangling help links in packages:"
echo SLACK_MESSAGE_HEADER=$header >> $GITHUB_ENV
context="*Branch:* <${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>\n*Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|$(echo ${{ github.sha }} | cut -c1-8) $(git log --format=%B -n 1 ${{ github.sha }} | head -n1)>"
echo SLACK_MESSAGE_CONTEXT=$context >> $GITHUB_ENV
echo -e "SLACK_MESSAGE_BODY=${SLACK_MESSAGE_BODY}" | sed -e '$ ! s/$/\\n/' -e 's/"/\\"/g' | tr -d '\n' >> $GITHUB_ENV
- name: Send test report to Slack
id: slack
if: ${{ steps.slack-prepare.outcome == 'success' }}
uses: slackapi/[email protected]
with:
channel-id: ${{ env.SLACK_CHANNEL }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE_HEADER }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE_BODY }}"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE_CONTEXT }}"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACKBOT_TOKEN }}