3 Commits

Author SHA1 Message Date
Matthias Pigulla
cb8b21017a Update version numbers in README for the next bugfix release 2021-04-07 12:30:27 +02:00
Matthias Pigulla
aed5400f20 Log when a key is _not_ used as a deploy key
Resolves #69.

Co-authored-by: Sean Killeen <SeanKilleen@gmail.com>
2021-03-17 18:50:49 +00:00
Matthias Pigulla
4681241867 Use case-insensitive regex matching when scanning key comments
Resolves #68, closes #70, closes #71.

Co-authored-by: Sean Killeen <SeanKilleen@gmail.com>
2021-03-17 18:27:52 +00:00
3 changed files with 9 additions and 5 deletions

View File

@@ -33,9 +33,9 @@ jobs:
...
steps:
- actions/checkout@v2
# Make sure the @v0.5.1 matches the current version of the
# Make sure the @v0.5.2 matches the current version of the
# action
- uses: webfactory/ssh-agent@v0.5.1
- uses: webfactory/ssh-agent@v0.5.2
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- ... other steps
@@ -50,7 +50,7 @@ You can set up different keys as different secrets and pass them all to the acti
```yaml
# ... contens as before
- uses: webfactory/ssh-agent@v0.5.1
- uses: webfactory/ssh-agent@v0.5.2
with:
ssh-private-key: |
${{ secrets.FIRST_KEY }}

4
dist/index.js vendored
View File

@@ -167,9 +167,11 @@ try {
console.log('Configuring deployment key(s)');
child_process.execFileSync(sshAdd, ['-L']).toString().split(/\r?\n/).forEach(function(key) {
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/);
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
if (!parts) {
console.log(`Comment for key '${key}' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.`);
return;
}

View File

@@ -50,9 +50,11 @@ try {
console.log('Configuring deployment key(s)');
child_process.execFileSync(sshAdd, ['-L']).toString().split(/\r?\n/).forEach(function(key) {
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/);
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
if (!parts) {
console.log(`Comment for key '${key}' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.`);
return;
}