diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index c93f9541..6233f8b1 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -50,17 +50,6 @@ jobs: cd $GITHUB_WORKSPACE/hammerspoon /usr/bin/python3 -m pip install -r requirements.txt - # If this is a PR, capture its number - - name: Capture PR number - if: github.event_name == 'pull_request' - run: echo ${GITHUB_REF} | awk 'BEGIN { FS = "/" } ; { print $3 }' >pr_num.txt - - name: Upload PR number - if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v2 - with: - name: pr_num.txt - path: pr_num.txt - # Find files modified by this PR - uses: lots0logs/gh-action-get-changed-files@2.1.4 with: @@ -74,22 +63,6 @@ jobs: - name: Docstrings Linter run: ./gh_actions_doclint.sh - # Store docstrings linter annotations as an artifact - - name: Upload linter artifacts - if: always() - uses: actions/upload-artifact@v2 - with: - name: annotations.json - path: annotations.json - - # NOTE: This will fail on third party PRs, until https://github.com/yuzutech/annotations-action/issues/23 is implemented - #- name: Publish Docstring Annotations - # uses: yuzutech/annotations-action@v0.3.0 - # with: - # repo-token: "${{ secrets.GITHUB_TOKEN }}" - # title: "Docstrings linter" - # input: annotations.json - # Fail CI run if docstrings failed - name: Check for docstring lint failures run: ./gh_actions_doclint.sh -v diff --git a/.github/workflows/PR_results.yml b/.github/workflows/PR_results.yml deleted file mode 100644 index c6d36914..00000000 --- a/.github/workflows/PR_results.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: PR Results - -on: - workflow_run: - workflows: ["PR"] - types: - - completed - -jobs: - publish: - name: "Publish PR Annotations" - runs-on: ubuntu-latest - if: always() - - steps: - - name: Download Artifacts - uses: actions/github-script@v3.1.0 - with: - script: | - var fs = require('fs'); - var path = require('path'); - var artifacts_path = path.join('${{github.workspace}}', 'artifacts') - fs.mkdirSync(artifacts_path, { recursive: true }) - - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{ github.event.workflow_run.id }}, - }); - - for (const artifact of artifacts.data.artifacts) { - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: artifact.id, - archive_format: 'zip', - }); - var artifact_path = path.join(artifacts_path, `${artifact.name}.zip`) - fs.writeFileSync(artifact_path, Buffer.from(download.data)); - console.log(`Downloaded ${artifact_path}`); - } - - name: Extract Artifacts - run: | - for file in artifacts/*.zip - do - if [ -f "$file" ] - then - dir="${file/%.zip/}" - mkdir -p "$dir" - unzip -d "$dir" "$file" - fi - done - - name: Show Artifacts - run: find artifacts -ls - - # Since proper annotations don't work in this context, we'll just add the JSON annotation output as a comment - - name: Check for a PR number - id: check_pr_number - uses: andstor/file-existence-action@v1 - with: - files: "artifacts/pr_num.txt/pr_num.txt" - - name: Add annotations output as a PR comment - if: steps.check_pr_number.outputs.files_exists == 'true' - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const fs = require('fs') - const pr_num = fs.readFileSync('artifacts/pr_num.txt/pr_num.txt', 'utf8') - const annotations = fs.readFileSync('artifacts/annotations.json/annotations.json', 'utf8') - github.rest.issues.createComment({ - issue_number: pr_num, - owner: 'hammerspoon', - repo: 'Spoons', - body: '```' + annotations + '```' - }) - - # This really ought to work, but the annotations disappear into the ether - # - name: Publish Docstring Annotations - # uses: cmsj/annotations-action@v0.4.0-cmsj-alpha - # with: - # repo-token: "${{ secrets.GITHUB_TOKEN }}" - # title: "Docstrings linter" - # input: "artifacts/annotations.json/annotations.json" - # commit: ${{ github.event.workflow_run.head_sha }} - diff --git a/Source/Seal.spoon/init.lua b/Source/Seal.spoon/init.lua index ffe1780b..9a38fcea 100644 --- a/Source/Seal.spoon/init.lua +++ b/Source/Seal.spoon/init.lua @@ -49,6 +49,7 @@ obj.plugin_search_paths = { hs.configdir .. "/seal_plugins", obj.spoonPath } --- Seal:refreshCommandsForPlugin(plugin_name) --- Method --- Refresh the list of commands provided by the given plugin. +--- This ought to generate a lint error --- --- Parameters: --- * plugin_name - the name of the plugin. Should be the name as passed to `loadPlugins()` or `loadPluginFromFile`.