Skip to content

Commit

Permalink
chore: Merge branch 'main' into fix/hash-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Apr 10, 2022
2 parents b6dbf56 + 45d6277 commit 18196fe
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/auto-bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Bump Version'

on:
push:
branches:
- 'main'

jobs:
bump-version:
name: 'Bump Version on main'
runs-on: ubuntu-latest

steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v2'
with:
ref: ${{ github.ref }}
- name: 'cat server/package.json'
run: cat ./server/package.json
- name: 'Automated Version Bump'
id: version-bump
uses: 'phips28/gh-action-bump-version@master'
with:
tag-prefix: 'v'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'cat server/package.json'
run: cat ./server/package.json
- name: 'Output Step'
env:
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
run: echo "new tag $NEW_TAG"
28 changes: 28 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
tags:
- 'v*'

name: Create Release

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Create Release
id: create_release
uses: juitnow/github-action-create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false
13 changes: 11 additions & 2 deletions server/migrations/20220410101019_hash-all-notion-tokens.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
const unHashToken = require("../lib/misc/unHashToken");
const hashToken = require("../lib/misc/hashToken");
const CryptoJS = require("crypto-js");

function unHashToken(token) {
return CryptoJS.AES.encrypt(token, process.env.THE_HASHING_SECRET).toString();
}

function hashToken(hashed) {
return CryptoJS.AES.decrypt(hashed, process.env.THE_HASHING_SECRET).toString(
CryptoJS.enc.Utf8
);
}

module.exports.up = (knex) => {
return knex
Expand Down

0 comments on commit 18196fe

Please sign in to comment.