Github actions

This commit is contained in:
Jarred Sumner
2024-06-17 18:07:55 -07:00
parent 46610c7254
commit 4ea31d474f
2 changed files with 18 additions and 7 deletions

View File

@@ -33,10 +33,21 @@ jobs:
run: |
LABELS=$(bun scripts/read-issue.ts)
echo "labels=$LABELS" >> $GITHUB_OUTPUT
bun scripts/is-outdated.ts
OUTDATED=$(bun scripts/is-outdated.ts)
echo "Is outdated: $OUTDATED"
echo "$OUTDATED" >> $GITHUB_OUTPUT
if [[ -f "is-outdated.txt" ]]; then
echo "is-outdated=true" >> $GITHUB_OUTPUT
fi
if [[ -f "outdated.txt" ]]; then
echo "oudated=$(cat outdated.txt)" >> $GITHUB_OUTPUT
fi
if [[ -f "latest.txt" ]]; then
echo "latest=$(cat latest.txt)" >> $GITHUB_OUTPUT
fi
rm -rf is-outdated.txt outdated.txt latest.txt
- name: Add labels
uses: actions-cool/issues-helper@v3
with:
@@ -52,7 +63,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
The latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but you are using v${{ steps.add-labels.outputs.oudated }}.
@${{ github.event.issue.user.login }}, the latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but you are using v${{ steps.add-labels.outputs.oudated }}.
If you upgrade to the latest version, does this fix the issue?

View File

@@ -30,7 +30,7 @@ const latest = await (async () => {
return cmake.slice(quote + 1, endQuote);
})();
console.write("latest=" + latest);
await Bun.write("latest.txt", latest);
const lines = body.split("\n").reverse();
for (const line of lines) {
@@ -52,8 +52,8 @@ for (const line of lines) {
}
if (Bun.semver.order(latest, version) === 1) {
console.write(",outdated=" + version);
console.write(",is-outdated=true");
await Bun.write("is-outdated.txt", "true");
await Bun.write("outdated.txt", version);
process.exit(0);
}
}