Skip to content

Commit

Permalink
fix: Skip missing observables
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Jul 3, 2024
1 parent 8fefa2f commit 4f92bcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ jobs:
id: observable
env:
DEBIAN_OBSERVABLES: ${{ inputs.DEBIAN_OBSERVABLES }}
OUTPUT_DIRECTORY: "apt/$DEBIAN_ROOT-observable/$DEBIAN_RELEASE/$DEBIAN_COMPONENT"
run: |
rm -rf apt/$DEBIAN_ROOT-observable/$DEBIAN_RELEASE/$DEBIAN_COMPONENT || true
rm -rf $OUTPUT_DIRECTORY || true
set -o pipefail
echo "log<<EOF" >> $GITHUB_OUTPUT
2>&1 npx --package @apt-repositories/generator@$GENERATOR_VERSION --command observe "apt/$DEBIAN_ROOT-observable/$DEBIAN_RELEASE/$DEBIAN_COMPONENT" | tee --append $GITHUB_OUTPUT
2>&1 npx --package @apt-repositories/generator@$GENERATOR_VERSION --command observe | tee --append $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
set +o pipefail
Expand Down
5 changes: 3 additions & 2 deletions source/observe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ const main = async () => {

const observedPathDebs = join("apt", observable, DEBIAN_COMPONENT);
if (!existsSync(observedPathDebs)) {
throw new Error(
`Observable '${observable}', expected at '${observedPathDebs}', was not found.`,
process.stderr.write(
` Observable '${observable}', expected at '${observedPathDebs}', was not found. Continuing...\n`,
);
continue;
}

process.stderr.write(` Reading contents of '${observedPathDebs}'...\n`);
Expand Down

0 comments on commit 4f92bcd

Please sign in to comment.