Skip to content

feat(conversation) - add Note to self conversation #3073

feat(conversation) - add Note to self conversation

feat(conversation) - add Note to self conversation #3073

# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# Use node together with node-when-unrelated to make eslint a required check for GitHub actions
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
name: Node
on:
pull_request:
paths-ignore:
- '.github/workflows/**'
- 'src/**'
- 'appinfo/info.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '**.js'
- '**.ts'
- '**.vue'
push:
branches:
- main
- master
- stable*
env:
PATHS_IGNORE: '.github/workflows/**;src/**;appinfo/info.xml;package.json;package-lock.json;tsconfig.json;**.js;**.ts;**.vue'
concurrency:
group: node-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
action-no-build:
permissions:
contents: none
runs-on: ubuntu-latest
name: action-not-src
outputs:
found_file: ${{ steps.confirm-negative-list.outputs.result }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Get changed files from diff
id: changed-files
run: |
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
else
echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi
- name: Set up node 20
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
with:
node-version: 20
- name: Install minimatch
run: npm i minimatch
- name: Check if a file is in paths-ignored
id: confirm-negative-list
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const { minimatch } = require('minimatch')
const changedPaths = "${{ steps.changed-files.outputs.changed_files }}".split(' ')
let matched = ''
process.env.PATHS_IGNORE.split(';').every(pattern => {
changedPaths.every(path => {
console.info('Testing ' + path + ' for pattern ' + pattern)
if (minimatch(path, pattern)) {
console.info(path + ' matched, aborting "unrelated summary"')
matched = '1'
return false
}
return true
})
return !matched
})
return matched
build:
permissions:
contents: none
runs-on: ubuntu-latest
needs: action-no-build
name: node
if: needs.action-no-build.outputs.found_file == ''
steps:
- name: Skip
run: 'echo "No JS/TS files changed, skipped Node"'