Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions .github/workflows/checkAndSubmitAddonMetadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ jobs:
const url = "GET /repos/" + process.env.GITHUB_REPOSITORY + "/compare/master..." + "${{ env.branchName }}"
const result = await github.request(url)
return getAddonFilename(result.data.files)
- name: Handle error in get add-on file name
if: ${{ failure() && steps.getAddonFileName.outcome == 'failure' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
if (Test-Path "./validationErrors.md") {
gh issue comment "${{ inputs.issueNumber }}" --body-file ./validationErrors.md
gh issue close "${{ inputs.issueNumber }}" --reason "not planned"
} else {
gh issue comment "${{ inputs.issueNumber }}" --body "Submission validation failed unexpectedly. Please wait for a staff member to respond. This may take up to 2 weeks."
}
- name: Determine add-on ID
uses: actions/github-script@v7
id: getAddonId
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/checkFilesChanged.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = getAddonFileName
const fs = require('fs')
const fs = require("fs")

function getAddonFileName(changedFiles) {
var addonFileName
Expand All @@ -8,21 +8,18 @@ function getAddonFileName(changedFiles) {
var errMsg
if (filename.startsWith("addons")) {
if (Boolean(addonFileName)){
errMsg = "Please submit addon releases individually. One file at a time."
fs.writeFileSync('./validationErrors.md', errMsg)
throw errMsg
throw "Multiple add-on files updated."
}
Comment thread
seanbudd marked this conversation as resolved.
if (fileData.status != "added") {
errMsg = "Modifications to submitted add-ons will not be auto-approved"
fs.writeFileSync('./validationErrors.md', errMsg)
errMsg = "This is a modification of a previously submitted add-on version. Please submit a new add-on version instead of modifying an existing one."
// Ensure an error message is passed on to the user when this happens.
fs.writeFileSync("./validationErrors.md", errMsg)
throw errMsg
}
addonFileName = filename
}
else {
errMsg = "Non-addon-submission files updated. This will not be auto-approved."
fs.writeFileSync('./validationErrors.md', errMsg)
throw errMsg
throw "Non-addon-submission files updated."
}
Comment thread
seanbudd marked this conversation as resolved.
}
return addonFileName
Expand Down
Loading