Skip to content

Commit

Permalink
Merge branch 'pre-linting' into feature/insert-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Aug 28, 2020
2 parents 811a8d4 + dd41e27 commit 41aec0d
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 133 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/close_issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: close-issues

# (c) 2020 by Linus Gasser for C4DT.org
# This action closes issues referenced in the PR in the case the merge
# does not happen on the 'default' branch.
# It searches for the same tags as the original github closers.

on:
pull_request:
types: [closed]
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: script
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = context.payload.pull_request;
if (!pr.merged){
console.log("Don't close issues when PR is not merged");
return;
}
const body = pr.body;
const lines = body.split('\n').map((l)=>l.trim());
const closers = new RegExp(
/(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)/i);
const issues = lines.filter((l)=>l.match(closers));
const issue_nbrs = issues.map((i) => i.replace(/.*#/, ''));
issue_nbrs.forEach((i) => {
console.log("Closing issue " + i);
github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: i,
body: `Closed by PR #${pr.number} ${pr.title}`
});
github.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: i,
state: 'closed'
});
});
13 changes: 13 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

Currently eligble versions for patches are the following

| Version | Supported |
| ------- | ------------------ |
| 1.x.x | :white_check_mark: |


## Reporting a Vulnerability
Please report (suspected) security vulnerabilities to [email protected]. You will receive a response from us within 48 hours. If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days.
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,13 @@ public byte[] getPayload(Map<String, List<GaenKey>> groupedBuckets)
ZipOutputStream zip = new ZipOutputStream(byteOut);

zip.putNextEntry(new ZipEntry("export.bin"));
byte[] exportBin = protoFile.toByteArray();
zip.write(EXPORT_MAGIC);
byte[] protoFileBytes = protoFile.toByteArray();
byte[] exportBin = new byte[EXPORT_MAGIC.length + protoFileBytes.length];
System.arraycopy(EXPORT_MAGIC, 0, exportBin, 0, EXPORT_MAGIC.length);
System.arraycopy(protoFileBytes, 0, exportBin, EXPORT_MAGIC.length, protoFileBytes.length);
zip.write(exportBin);
zip.closeEntry();

var signatureList = getSignatureObject(exportBin);

byte[] exportSig = signatureList.toByteArray();
Expand Down
Loading

0 comments on commit 41aec0d

Please sign in to comment.