Skip to content

Commit

Permalink
List tags
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisHsu committed Feb 29, 2024
1 parent 88721ac commit 4c94ed2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- name: Test action
uses: ./
with:
token: ${{secrets.GITHUB_TOKEN}}
assets: |-
a.deb
b.deb
16 changes: 9 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ const Path = require("path")
const fs = require('fs')

try {
// Get octokit
const Octokit = Github.getOctokit(Core.getInput('token'));
// Read & parse release note
const note_path = Path.resolve(Core.getInput('note'));
console.log(`Note ${note_path}`);
const note_content = fs.readFileSync(note_path, {encoding: 'utf8'})
const [tag_str, tag_name] = note_content.match(/^\`(.*)\`\n/)
note_content = note_content.substring(tag_str.length)
console.log(note_content)
console.log(tag_name)
let note_content = fs.readFileSync(Path.resolve(Core.getInput('note')), {encoding: 'utf8'});
const [tag_str, tag_name] = note_content.match(/^\`(.*)\`\n/);
note_content = note_content.substring(tag_str.length);
// Get tags
let tags = fs.readdirSync(Path.resolve(".git", "refs", "tags"))
console.log(tags)

// Get assets
const asset_paths = Core.getInput('assets').split("\n").map(s => s.trim());
console.log(`Assets: ${asset_paths}`);
Expand Down

0 comments on commit 4c94ed2

Please sign in to comment.